<?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 Version20250206143409 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 carte_cadeau_history (id INT AUTO_INCREMENT NOT NULL, code_id INT DEFAULT NULL, created_at DATETIME NOT NULL, modifier VARCHAR(255) DEFAULT NULL, discr VARCHAR(255) NOT NULL, INDEX IDX_EAD03ED827DAFE17 (code_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE change_carte_cadeau (id INT AUTO_INCREMENT NOT NULL, update_carte_cadeau_history_id INT NOT NULL, field VARCHAR(255) NOT NULL, old_value LONGTEXT DEFAULT NULL, new_value LONGTEXT DEFAULT NULL, INDEX IDX_A0638F003B696D3B (update_carte_cadeau_history_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE create_carte_cadeau_history (id INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE send_confirmation_carte_cadeau_history (id INT NOT NULL, log_email_id INT NOT NULL, INDEX IDX_82C7279BC6610A16 (log_email_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE update_carte_cadeau_history (id INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE carte_cadeau_history ADD CONSTRAINT FK_EAD03ED827DAFE17 FOREIGN KEY (code_id) REFERENCES code (id)');
$this->addSql('ALTER TABLE change_carte_cadeau ADD CONSTRAINT FK_A0638F003B696D3B FOREIGN KEY (update_carte_cadeau_history_id) REFERENCES update_carte_cadeau_history (id)');
$this->addSql('ALTER TABLE create_carte_cadeau_history ADD CONSTRAINT FK_56E52AA7BF396750 FOREIGN KEY (id) REFERENCES carte_cadeau_history (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE send_confirmation_carte_cadeau_history ADD CONSTRAINT FK_82C7279BC6610A16 FOREIGN KEY (log_email_id) REFERENCES log_email (id)');
$this->addSql('ALTER TABLE send_confirmation_carte_cadeau_history ADD CONSTRAINT FK_82C7279BBF396750 FOREIGN KEY (id) REFERENCES carte_cadeau_history (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE update_carte_cadeau_history ADD CONSTRAINT FK_4090754BF396750 FOREIGN KEY (id) REFERENCES carte_cadeau_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 carte_cadeau_history DROP FOREIGN KEY FK_EAD03ED827DAFE17');
$this->addSql('ALTER TABLE change_carte_cadeau DROP FOREIGN KEY FK_A0638F003B696D3B');
$this->addSql('ALTER TABLE create_carte_cadeau_history DROP FOREIGN KEY FK_56E52AA7BF396750');
$this->addSql('ALTER TABLE send_confirmation_carte_cadeau_history DROP FOREIGN KEY FK_82C7279BC6610A16');
$this->addSql('ALTER TABLE send_confirmation_carte_cadeau_history DROP FOREIGN KEY FK_82C7279BBF396750');
$this->addSql('ALTER TABLE update_carte_cadeau_history DROP FOREIGN KEY FK_4090754BF396750');
$this->addSql('DROP TABLE carte_cadeau_history');
$this->addSql('DROP TABLE change_carte_cadeau');
$this->addSql('DROP TABLE create_carte_cadeau_history');
$this->addSql('DROP TABLE send_confirmation_carte_cadeau_history');
$this->addSql('DROP TABLE update_carte_cadeau_history');
}
}