<?php
declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20211108101907 extends AbstractMigration
{
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE questionnaire_acronym');
$this->addSql('ALTER TABLE legal_entity ADD acronym VARCHAR(255) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE questionnaire_acronym (id INT AUTO_INCREMENT NOT NULL, entity_id INT DEFAULT NULL, acronym VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, created_at DATETIME NOT NULL COMMENT \'(DC2Type:carbondatetime)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:carbondatetime)\', UNIQUE INDEX UNIQ_EB1A65681257D5D (entity_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE questionnaire_acronym ADD CONSTRAINT FK_EB1A65681257D5D FOREIGN KEY (entity_id) REFERENCES legal_entity (id)');
$this->addSql('ALTER TABLE legal_entity DROP acronym');
}
}