migrations/Version20250708140317.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 Version20250708140317 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('CREATE TABLE change_privatisation (id INT AUTO_INCREMENT NOT NULL, update_privatisation_history_id INT DEFAULT NULL, extra_reservation_id INT DEFAULT NULL, option_quantity_reservation_id INT DEFAULT NULL, option_select_reservation_id INT DEFAULT NULL, field VARCHAR(255) NOT NULL, old_value LONGTEXT DEFAULT NULL, new_value LONGTEXT DEFAULT NULL, INDEX IDX_E2461CC72D49F63 (update_privatisation_history_id), INDEX IDX_E2461CC2CCDCF5F (extra_reservation_id), INDEX IDX_E2461CC4991B8F0 (option_quantity_reservation_id), INDEX IDX_E2461CCF29B8997 (option_select_reservation_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('CREATE TABLE create_privatisation_history (id INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('CREATE TABLE privatisation_history (id INT AUTO_INCREMENT NOT NULL, privatisation_id INT DEFAULT NULL, created_at DATETIME NOT NULL, modifier VARCHAR(255) DEFAULT NULL, discr VARCHAR(255) NOT NULL, INDEX IDX_1E65406ECE4BE7FC (privatisation_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  21.         $this->addSql('CREATE TABLE send_confirmation_privatisation_history (id INT NOT NULL, log_email_id INT NOT NULL, INDEX IDX_F1D8475DC6610A16 (log_email_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  22.         $this->addSql('CREATE TABLE update_privatisation_history (id INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  23.         $this->addSql('ALTER TABLE change_privatisation ADD CONSTRAINT FK_E2461CC72D49F63 FOREIGN KEY (update_privatisation_history_id) REFERENCES update_privatisation_history (id)');
  24.         $this->addSql('ALTER TABLE change_privatisation ADD CONSTRAINT FK_E2461CC2CCDCF5F FOREIGN KEY (extra_reservation_id) REFERENCES extra_reservation (id)');
  25.         $this->addSql('ALTER TABLE change_privatisation ADD CONSTRAINT FK_E2461CC4991B8F0 FOREIGN KEY (option_quantity_reservation_id) REFERENCES abstract_option_reservation (id)');
  26.         $this->addSql('ALTER TABLE change_privatisation ADD CONSTRAINT FK_E2461CCF29B8997 FOREIGN KEY (option_select_reservation_id) REFERENCES abstract_option_reservation (id)');
  27.         $this->addSql('ALTER TABLE create_privatisation_history ADD CONSTRAINT FK_DE6319D7BF396750 FOREIGN KEY (id) REFERENCES privatisation_history (id) ON DELETE CASCADE');
  28.         $this->addSql('ALTER TABLE privatisation_history ADD CONSTRAINT FK_1E65406ECE4BE7FC FOREIGN KEY (privatisation_id) REFERENCES privatisation (id)');
  29.         $this->addSql('ALTER TABLE send_confirmation_privatisation_history ADD CONSTRAINT FK_F1D8475DC6610A16 FOREIGN KEY (log_email_id) REFERENCES log_email (id)');
  30.         $this->addSql('ALTER TABLE send_confirmation_privatisation_history ADD CONSTRAINT FK_F1D8475DBF396750 FOREIGN KEY (id) REFERENCES privatisation_history (id) ON DELETE CASCADE');
  31.         $this->addSql('ALTER TABLE update_privatisation_history ADD CONSTRAINT FK_FA85565CBF396750 FOREIGN KEY (id) REFERENCES privatisation_history (id) ON DELETE CASCADE');
  32.     }
  33.     public function down(Schema $schema): void
  34.     {
  35.         // this down() migration is auto-generated, please modify it to your needs
  36.         $this->addSql('ALTER TABLE change_privatisation DROP FOREIGN KEY FK_E2461CC72D49F63');
  37.         $this->addSql('ALTER TABLE change_privatisation DROP FOREIGN KEY FK_E2461CC2CCDCF5F');
  38.         $this->addSql('ALTER TABLE change_privatisation DROP FOREIGN KEY FK_E2461CC4991B8F0');
  39.         $this->addSql('ALTER TABLE change_privatisation DROP FOREIGN KEY FK_E2461CCF29B8997');
  40.         $this->addSql('ALTER TABLE create_privatisation_history DROP FOREIGN KEY FK_DE6319D7BF396750');
  41.         $this->addSql('ALTER TABLE privatisation_history DROP FOREIGN KEY FK_1E65406ECE4BE7FC');
  42.         $this->addSql('ALTER TABLE send_confirmation_privatisation_history DROP FOREIGN KEY FK_F1D8475DC6610A16');
  43.         $this->addSql('ALTER TABLE send_confirmation_privatisation_history DROP FOREIGN KEY FK_F1D8475DBF396750');
  44.         $this->addSql('ALTER TABLE update_privatisation_history DROP FOREIGN KEY FK_FA85565CBF396750');
  45.         $this->addSql('DROP TABLE change_privatisation');
  46.         $this->addSql('DROP TABLE create_privatisation_history');
  47.         $this->addSql('DROP TABLE privatisation_history');
  48.         $this->addSql('DROP TABLE send_confirmation_privatisation_history');
  49.         $this->addSql('DROP TABLE update_privatisation_history');
  50.     }
  51. }