<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20211027142524 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE theme');
$this->addSql('CREATE TABLE theme (id INT AUTO_INCREMENT NOT NULL, lang_id INT DEFAULT NULL, id_iresa INT NOT NULL, code_traduction VARCHAR(255) NOT NULL, nom VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, slug VARCHAR(255) NOT NULL, ordre INT DEFAULT NULL, INDEX IDX_9775E708B213FA4 (lang_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE theme ADD CONSTRAINT FK_9775E708B213FA4 FOREIGN KEY (lang_id) REFERENCES language (id)');
$this->addSql('ALTER TABLE typologie CHANGE code_traduction code_traduction VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE theme');
$this->addSql('ALTER TABLE typologie CHANGE code_traduction code_traduction VARCHAR(255) NOT NULL COLLATE utf8_unicode_ci');
}
}