migrations/Version20240929225615.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 Version20240929225615 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 change_reservation ADD option_select_reservation_id INT DEFAULT NULL, ADD extra_reservation_id INT DEFAULT NULL, CHANGE id_reference option_quantity_reservation_id INT DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE change_reservation ADD CONSTRAINT FK_5AABF20F4991B8F0 FOREIGN KEY (option_quantity_reservation_id) REFERENCES abstract_option_reservation (id)');
  20.         $this->addSql('ALTER TABLE change_reservation ADD CONSTRAINT FK_5AABF20FF29B8997 FOREIGN KEY (option_select_reservation_id) REFERENCES abstract_option_reservation (id)');
  21.         $this->addSql('ALTER TABLE change_reservation ADD CONSTRAINT FK_5AABF20F2CCDCF5F FOREIGN KEY (extra_reservation_id) REFERENCES extra_reservation (id)');
  22.         $this->addSql('CREATE INDEX IDX_5AABF20F4991B8F0 ON change_reservation (option_quantity_reservation_id)');
  23.         $this->addSql('CREATE INDEX IDX_5AABF20FF29B8997 ON change_reservation (option_select_reservation_id)');
  24.         $this->addSql('CREATE INDEX IDX_5AABF20F2CCDCF5F ON change_reservation (extra_reservation_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 change_reservation DROP FOREIGN KEY FK_5AABF20F4991B8F0');
  30.         $this->addSql('ALTER TABLE change_reservation DROP FOREIGN KEY FK_5AABF20FF29B8997');
  31.         $this->addSql('ALTER TABLE change_reservation DROP FOREIGN KEY FK_5AABF20F2CCDCF5F');
  32.         $this->addSql('DROP INDEX IDX_5AABF20F4991B8F0 ON change_reservation');
  33.         $this->addSql('DROP INDEX IDX_5AABF20FF29B8997 ON change_reservation');
  34.         $this->addSql('DROP INDEX IDX_5AABF20F2CCDCF5F ON change_reservation');
  35.         $this->addSql('ALTER TABLE change_reservation ADD id_reference INT DEFAULT NULL, DROP option_quantity_reservation_id, DROP option_select_reservation_id, DROP extra_reservation_id');
  36.     }
  37. }