migrations/Version20211207134533.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20211207134533 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->addSql('ALTER TABLE registrars DROP FOREIGN KEY FK_6824AEAF92F3E70');
  19.         $this->addSql('DROP INDEX uniq_6824aea5e237e06 ON registrars');
  20.         $this->addSql('CREATE UNIQUE INDEX UNIQ_1E00923E5E237E06 ON registrars (name)');
  21.         $this->addSql('DROP INDEX uniq_6824aea4fbf094f ON registrars');
  22.         $this->addSql('CREATE UNIQUE INDEX UNIQ_1E00923E4FBF094F ON registrars (company)');
  23.         $this->addSql('DROP INDEX idx_6824aeaf92f3e70 ON registrars');
  24.         $this->addSql('CREATE INDEX IDX_1E00923EF92F3E70 ON registrars (country_id)');
  25.         $this->addSql('ALTER TABLE registrars ADD CONSTRAINT FK_6824AEAF92F3E70 FOREIGN KEY (country_id) REFERENCES countries (id)');
  26.     }
  27.     public function down(Schema $schema): void
  28.     {
  29.         // this down() migration is auto-generated, please modify it to your needs
  30.         $this->addSql('ALTER TABLE registrars DROP FOREIGN KEY FK_1E00923EF92F3E70');
  31.         $this->addSql('DROP INDEX idx_1e00923ef92f3e70 ON registrars');
  32.         $this->addSql('CREATE INDEX IDX_6824AEAF92F3E70 ON registrars (country_id)');
  33.         $this->addSql('DROP INDEX uniq_1e00923e5e237e06 ON registrars');
  34.         $this->addSql('CREATE UNIQUE INDEX UNIQ_6824AEA5E237E06 ON registrars (name)');
  35.         $this->addSql('DROP INDEX uniq_1e00923e4fbf094f ON registrars');
  36.         $this->addSql('CREATE UNIQUE INDEX UNIQ_6824AEA4FBF094F ON registrars (company)');
  37.         $this->addSql('ALTER TABLE registrars ADD CONSTRAINT FK_1E00923EF92F3E70 FOREIGN KEY (country_id) REFERENCES countries (id)');
  38.     }
  39. }