<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240513071219 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add domain variation entity';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('
CREATE TABLE domain_variation (
id INT AUTO_INCREMENT NOT NULL,
domain_pool LONGTEXT NOT NULL COMMENT \'(DC2Type:simple_array)\',
created DATETIME NOT NULL,
updated DATETIME NOT NULL,
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE tracker_domain_adserver_map ADD created DATETIME NOT NULL, ADD updated DATETIME NOT NULL');
$this->addSql("INSERT INTO geoedge.domain_variation (domain_pool, created, updated)
VALUES
('amazon.com,amazon.ca,amazon.uk,amazon.es', NOW(), NOW()),
('kayak.com,kayak.fr,kayak.de', NOW(), NOW()),
('dyson.com,dyson.com.au', NOW(), NOW()),
('kingsize.com,kingsizedirect.com', NOW(), NOW()),
('underarmour.com,underarmour.ca', NOW(), NOW());"
);
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE domain_variation');
$this->addSql('ALTER TABLE tracker_domain_adserver_map DROP created, DROP updated');
}
}