<?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 Version20220906112904 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 locale (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE locale ADD created_at DATETIME NOT NULL, ADD updated_at DATETIME NOT NULL');
$this->addSql('ALTER TABLE parameter ADD locale_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE parameter ADD CONSTRAINT FK_2A979110E559DFD1 FOREIGN KEY (locale_id) REFERENCES locale (id)');
$this->addSql('CREATE INDEX IDX_2A979110E559DFD1 ON parameter (locale_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE parameter DROP FOREIGN KEY FK_2A979110E559DFD1');
$this->addSql('DROP TABLE locale');
$this->addSql('ALTER TABLE locale DROP created_at, DROP updated_at');
$this->addSql('DROP INDEX IDX_2A979110E559DFD1 ON parameter');
$this->addSql('ALTER TABLE parameter DROP locale_id');
}
}