migrations/Version20251112155725.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20251112155725 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Adiciona campos de sessão, fingerprint e localização à tabela std_ads_tracking';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql(<<<'SQL'
  18.             ALTER TABLE `std_ads_tracking`
  19.             ADD COLUMN `session_hash` VARCHAR(255) DEFAULT NULL AFTER `event_type`,
  20.             ADD COLUMN `tracking_id` VARCHAR(255) DEFAULT NULL AFTER `session_hash`,
  21.             ADD COLUMN `hashed_ip` VARCHAR(255) DEFAULT NULL AFTER `ip`,
  22.             ADD COLUMN `fingerprint` VARCHAR(255) DEFAULT NULL AFTER `hashed_ip`,
  23.             ADD COLUMN `country` VARCHAR(255) DEFAULT NULL AFTER `fingerprint`,
  24.             ADD COLUMN `city` VARCHAR(255) DEFAULT NULL AFTER `country`,
  25.             ADD COLUMN `precise_country` VARCHAR(255) DEFAULT NULL AFTER `city`,
  26.             ADD COLUMN `precise_city` VARCHAR(255) DEFAULT NULL AFTER `precise_country`;
  27.         SQL);
  28.     }
  29.     public function down(Schema $schema): void
  30.     {
  31.         $this->addSql(<<<'SQL'
  32.             ALTER TABLE `std_ads_tracking`
  33.             DROP COLUMN `session_hash`,
  34.             DROP COLUMN `tracking_id`,
  35.             DROP COLUMN `hashed_ip`,
  36.             DROP COLUMN `fingerprint`,
  37.             DROP COLUMN `country`,
  38.             DROP COLUMN `city`,
  39.             DROP COLUMN `precise_country`,
  40.             DROP COLUMN `precise_city`;
  41.         SQL);
  42.     }
  43. }