<?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 Version20220609183315 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 allergen (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE allergen_translation (id INT AUTO_INCREMENT NOT NULL, allergen_id INT NOT NULL, name VARCHAR(255) NOT NULL, lang VARCHAR(4) NOT NULL, INDEX IDX_5E190A826E775A4A (allergen_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE allergen_translation ADD CONSTRAINT FK_5E190A826E775A4A FOREIGN KEY (allergen_id) REFERENCES allergen (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE allergen_translation DROP FOREIGN KEY FK_5E190A826E775A4A');
$this->addSql('DROP TABLE allergen');
$this->addSql('DROP TABLE allergen_translation');
}
}