migrations/Version20210201162341.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\Migrations\AbstractMigration;
  5. use Doctrine\DBAL\Schema\Schema;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. class Version20210201162341 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  19.         $this->addSql('ALTER TABLE infos_discover_link ADD CONSTRAINT FK_696EBB9FB213FA4 FOREIGN KEY (lang_id) REFERENCES language (id)');
  20.         $this->addSql('CREATE INDEX IDX_696EBB9FB213FA4 ON infos_discover_link (lang_id)');
  21.         $this->addSql('ALTER TABLE infos_discover ADD CONSTRAINT FK_3FE06DAAB213FA4 FOREIGN KEY (lang_id) REFERENCES language (id)');
  22.         $this->addSql('CREATE INDEX IDX_3FE06DAAB213FA4 ON infos_discover (lang_id)');
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  28.         $this->addSql('ALTER TABLE infos_discover DROP FOREIGN KEY FK_3FE06DAAB213FA4');
  29.         $this->addSql('DROP INDEX IDX_3FE06DAAB213FA4 ON infos_discover');
  30.         $this->addSql('ALTER TABLE infos_discover_link DROP FOREIGN KEY FK_696EBB9FB213FA4');
  31.         $this->addSql('DROP INDEX IDX_696EBB9FB213FA4 ON infos_discover_link');
  32.         $this->addSql('ALTER TABLE infos_event ADD CONSTRAINT FK_7456EA85B213FA4 FOREIGN KEY (lang_id) REFERENCES language (id)');
  33.         $this->addSql('CREATE INDEX IDX_7456EA85B213FA4 ON infos_event (lang_id)');
  34.     }
  35. }