<?php
declare(strict_types=1);
namespace TicketsBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20241113081307 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE tickets_bundle__closing_motif (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', name VARCHAR(30) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_C1E94FD3B03A8386 (created_by_id), INDEX IDX_C1E94FD3896DBBDE (updated_by_id), INDEX IDX_C1E94FD3C76F1F52 (deleted_by_id), INDEX name (name), INDEX deleted_at (deleted_at), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE tickets_bundle__closing_motif ADD CONSTRAINT FK_C1E94FD3B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE tickets_bundle__closing_motif ADD CONSTRAINT FK_C1E94FD3896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE tickets_bundle__closing_motif ADD CONSTRAINT FK_C1E94FD3C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE tickets_bundle__ticket ADD closing_motif_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE tickets_bundle__ticket ADD CONSTRAINT FK_F69B6D72BACBA8CB FOREIGN KEY (closing_motif_id) REFERENCES tickets_bundle__closing_motif (id)');
$this->addSql('CREATE INDEX IDX_F69B6D72BACBA8CB ON tickets_bundle__ticket (closing_motif_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE tickets_bundle__ticket DROP FOREIGN KEY FK_F69B6D72BACBA8CB');
$this->addSql('ALTER TABLE tickets_bundle__closing_motif DROP FOREIGN KEY FK_C1E94FD3B03A8386');
$this->addSql('ALTER TABLE tickets_bundle__closing_motif DROP FOREIGN KEY FK_C1E94FD3896DBBDE');
$this->addSql('ALTER TABLE tickets_bundle__closing_motif DROP FOREIGN KEY FK_C1E94FD3C76F1F52');
$this->addSql('DROP TABLE tickets_bundle__closing_motif');
$this->addSql('DROP INDEX IDX_F69B6D72BACBA8CB ON tickets_bundle__ticket');
$this->addSql('ALTER TABLE tickets_bundle__ticket DROP closing_motif_id');
}
}