<?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 Version20210914142008 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE resource_source (id VARCHAR(255) NOT NULL, display VARCHAR(100) NOT NULL, sequence INT DEFAULT 0 NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('INSERT INTO resource_source (id, display, sequence) VALUES ("small_ads", "Small ads", 0)');
$this->addSql('INSERT INTO resource_source (id, display, sequence) VALUES ("facebook", "Facebook", 0)');
$this->addSql('INSERT INTO resource_source (id, display, sequence) VALUES ("recommendation", "Recommendation", 0)');
$this->addSql('INSERT INTO resource_source (id, display, sequence) VALUES ("other", "Other", 99)');
$this->addSql('ALTER TABLE resource ADD registered_at DATETIME DEFAULT NULL, ADD source VARCHAR(50) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE resource_source');
$this->addSql('ALTER TABLE resource DROP registered_at, DROP source');
}
}