<?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 Version20220329121218 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('ALTER TABLE miseenavant ADD lang_id INT DEFAULT NULL');
$this->addSql('SET FOREIGN_KEY_CHECKS=0;');
$this->addSql('ALTER TABLE miseenavant ADD CONSTRAINT FK_6865EA68B213FA4 FOREIGN KEY (lang_id) REFERENCES language (id)');
$this->addSql('CREATE INDEX IDX_6865EA68B213FA4 ON miseenavant (lang_id)');
$this->addSql('UPDATE miseenavant set lang_id = 1');
$this->addSql('SET FOREIGN_KEY_CHECKS=1;');
}
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('ALTER TABLE miseenavant DROP FOREIGN KEY FK_6865EA68B213FA4');
$this->addSql('DROP INDEX IDX_6865EA68B213FA4 ON miseenavant');
$this->addSql('ALTER TABLE miseenavant DROP lang_id');
}
}