migrations/Version20240513071219.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 Version20240513071219 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Add domain variation entity';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('
  19.                 CREATE TABLE domain_variation (
  20.                     id INT AUTO_INCREMENT NOT NULL,
  21.                     domain_pool LONGTEXT NOT NULL COMMENT \'(DC2Type:simple_array)\',
  22.                     created DATETIME NOT NULL,
  23.                     updated DATETIME NOT NULL,
  24.                     PRIMARY KEY(id)
  25.                 ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  26.         $this->addSql('ALTER TABLE tracker_domain_adserver_map ADD created DATETIME NOT NULL, ADD updated DATETIME NOT NULL');
  27.         $this->addSql("INSERT INTO geoedge.domain_variation (domain_pool, created, updated)
  28.                             VALUES
  29.                             ('amazon.com,amazon.ca,amazon.uk,amazon.es', NOW(), NOW()),
  30.                             ('kayak.com,kayak.fr,kayak.de', NOW(), NOW()),
  31.                             ('dyson.com,dyson.com.au', NOW(), NOW()),
  32.                             ('kingsize.com,kingsizedirect.com', NOW(), NOW()),
  33.                             ('underarmour.com,underarmour.ca', NOW(), NOW());"
  34.         );
  35.     }
  36.     public function down(Schema $schema): void
  37.     {
  38.         // this down() migration is auto-generated, please modify it to your needs
  39.         $this->addSql('DROP TABLE domain_variation');
  40.         $this->addSql('ALTER TABLE tracker_domain_adserver_map DROP created, DROP updated');
  41.     }
  42. }