<?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 Version20250113184427 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('ALTER TABLE checklist_task DROP FOREIGN KEY FK_D48EDEC2B16D08A7');
$this->addSql('ALTER TABLE checklist_task DROP FOREIGN KEY FK_6EB0E2498DB60186');
$this->addSql('DROP TABLE checklist_task');
$this->addSql('ALTER TABLE task ADD checklist_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE task ADD CONSTRAINT FK_527EDB25B16D08A7 FOREIGN KEY (checklist_id) REFERENCES checklist (id)');
$this->addSql('CREATE INDEX IDX_527EDB25B16D08A7 ON task (checklist_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE checklist_task (checklist_id CHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:uuid)\', task_id CHAR(36) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:uuid)\', UNIQUE INDEX UNIQ_D48EDEC28DB60186 (task_id), INDEX IDX_D48EDEC2B16D08A7 (checklist_id), PRIMARY KEY(checklist_id, task_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE checklist_task ADD CONSTRAINT FK_D48EDEC2B16D08A7 FOREIGN KEY (checklist_id) REFERENCES checklist (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE checklist_task ADD CONSTRAINT FK_6EB0E2498DB60186 FOREIGN KEY (task_id) REFERENCES task (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('ALTER TABLE task DROP FOREIGN KEY FK_527EDB25B16D08A7');
$this->addSql('DROP INDEX IDX_527EDB25B16D08A7 ON task');
$this->addSql('ALTER TABLE task DROP checklist_id');
}
}