From df2921450912e59f974676f37e86d43d35d08611 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Thu, 12 Mar 2026 11:48:43 +0100 Subject: [PATCH] feat(backend) : add migration to remove project_id from task_status --- migrations/Version20260312104832.php | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 migrations/Version20260312104832.php diff --git a/migrations/Version20260312104832.php b/migrations/Version20260312104832.php new file mode 100644 index 0000000..70637ce --- /dev/null +++ b/migrations/Version20260312104832.php @@ -0,0 +1,35 @@ +addSql('ALTER TABLE task_status DROP CONSTRAINT fk_40a9e1cf166d1f9c'); + $this->addSql('DROP INDEX idx_40a9e1cf166d1f9c'); + $this->addSql('ALTER TABLE task_status DROP project_id'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE task_status ADD project_id INT NOT NULL'); + $this->addSql('ALTER TABLE task_status ADD CONSTRAINT fk_40a9e1cf166d1f9c FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('CREATE INDEX idx_40a9e1cf166d1f9c ON task_status (project_id)'); + } +}