<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250708140317 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$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');
$this->addSql('CREATE TABLE create_privatisation_history (id INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$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');
$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');
$this->addSql('CREATE TABLE update_privatisation_history (id INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE change_privatisation ADD CONSTRAINT FK_E2461CC72D49F63 FOREIGN KEY (update_privatisation_history_id) REFERENCES update_privatisation_history (id)');
$this->addSql('ALTER TABLE change_privatisation ADD CONSTRAINT FK_E2461CC2CCDCF5F FOREIGN KEY (extra_reservation_id) REFERENCES extra_reservation (id)');
$this->addSql('ALTER TABLE change_privatisation ADD CONSTRAINT FK_E2461CC4991B8F0 FOREIGN KEY (option_quantity_reservation_id) REFERENCES abstract_option_reservation (id)');
$this->addSql('ALTER TABLE change_privatisation ADD CONSTRAINT FK_E2461CCF29B8997 FOREIGN KEY (option_select_reservation_id) REFERENCES abstract_option_reservation (id)');
$this->addSql('ALTER TABLE create_privatisation_history ADD CONSTRAINT FK_DE6319D7BF396750 FOREIGN KEY (id) REFERENCES privatisation_history (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE privatisation_history ADD CONSTRAINT FK_1E65406ECE4BE7FC FOREIGN KEY (privatisation_id) REFERENCES privatisation (id)');
$this->addSql('ALTER TABLE send_confirmation_privatisation_history ADD CONSTRAINT FK_F1D8475DC6610A16 FOREIGN KEY (log_email_id) REFERENCES log_email (id)');
$this->addSql('ALTER TABLE send_confirmation_privatisation_history ADD CONSTRAINT FK_F1D8475DBF396750 FOREIGN KEY (id) REFERENCES privatisation_history (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE update_privatisation_history ADD CONSTRAINT FK_FA85565CBF396750 FOREIGN KEY (id) REFERENCES privatisation_history (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE change_privatisation DROP FOREIGN KEY FK_E2461CC72D49F63');
$this->addSql('ALTER TABLE change_privatisation DROP FOREIGN KEY FK_E2461CC2CCDCF5F');
$this->addSql('ALTER TABLE change_privatisation DROP FOREIGN KEY FK_E2461CC4991B8F0');
$this->addSql('ALTER TABLE change_privatisation DROP FOREIGN KEY FK_E2461CCF29B8997');
$this->addSql('ALTER TABLE create_privatisation_history DROP FOREIGN KEY FK_DE6319D7BF396750');
$this->addSql('ALTER TABLE privatisation_history DROP FOREIGN KEY FK_1E65406ECE4BE7FC');
$this->addSql('ALTER TABLE send_confirmation_privatisation_history DROP FOREIGN KEY FK_F1D8475DC6610A16');
$this->addSql('ALTER TABLE send_confirmation_privatisation_history DROP FOREIGN KEY FK_F1D8475DBF396750');
$this->addSql('ALTER TABLE update_privatisation_history DROP FOREIGN KEY FK_FA85565CBF396750');
$this->addSql('DROP TABLE change_privatisation');
$this->addSql('DROP TABLE create_privatisation_history');
$this->addSql('DROP TABLE privatisation_history');
$this->addSql('DROP TABLE send_confirmation_privatisation_history');
$this->addSql('DROP TABLE update_privatisation_history');
}
}