migrations/Version20221018171704.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 Version20221018171704 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 operation ADD destination_supplier_id INT DEFAULT NULL, ADD destination_provider_id INT DEFAULT NULL, ADD destination_slot_id INT DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66DFEF86B7 FOREIGN KEY (destination_supplier_id) REFERENCES supplier (id)');
  20.         $this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66D2F614391 FOREIGN KEY (destination_provider_id) REFERENCES provider (id)');
  21.         $this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66D37DC2EE4 FOREIGN KEY (destination_slot_id) REFERENCES slot (id)');
  22.         $this->addSql('CREATE INDEX IDX_1981A66DFEF86B7 ON operation (destination_supplier_id)');
  23.         $this->addSql('CREATE INDEX IDX_1981A66D2F614391 ON operation (destination_provider_id)');
  24.         $this->addSql('CREATE INDEX IDX_1981A66D37DC2EE4 ON operation (destination_slot_id)');
  25.     }
  26.     public function down(Schema $schema): void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->addSql('ALTER TABLE operation DROP FOREIGN KEY FK_1981A66DFEF86B7');
  30.         $this->addSql('ALTER TABLE operation DROP FOREIGN KEY FK_1981A66D2F614391');
  31.         $this->addSql('ALTER TABLE operation DROP FOREIGN KEY FK_1981A66D37DC2EE4');
  32.         $this->addSql('DROP INDEX IDX_1981A66DFEF86B7 ON operation');
  33.         $this->addSql('DROP INDEX IDX_1981A66D2F614391 ON operation');
  34.         $this->addSql('DROP INDEX IDX_1981A66D37DC2EE4 ON operation');
  35.         $this->addSql('ALTER TABLE operation DROP destination_supplier_id, DROP destination_provider_id, DROP destination_slot_id');
  36.     }
  37. }