<?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 Version20211109133718 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 seo (id INT AUTO_INCREMENT NOT NULL, meta_description VARCHAR(155) NOT NULL, title VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE seokeyword (id INT AUTO_INCREMENT NOT NULL, seo_id INT NOT NULL, word VARCHAR(255) NOT NULL, INDEX IDX_26348E5497E3DD86 (seo_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE seokeyword ADD CONSTRAINT FK_26348E5497E3DD86 FOREIGN KEY (seo_id) REFERENCES seo (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE seokeyword DROP FOREIGN KEY FK_26348E5497E3DD86');
$this->addSql('DROP TABLE seo');
$this->addSql('DROP TABLE seokeyword');
}
}