From 003cccfdc4123dfd423092559bcb8a2442591940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 8 Apr 2026 22:26:53 +0200 Subject: [PATCH] Update foreign key constraint to include `ON DELETE CASCADE` for `storedobjectlock_uuid` - Modified migration `Version20260331122339` to apply `ON DELETE CASCADE` to the foreign key constraint on `storedobjectlock_uuid` in `stored_object_lock_user` table. - Ensures dependent records are removed automatically when the parent `stored_object_lock` is deleted. --- .../ChillDocStoreBundle/migrations/Version20260331122339.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillDocStoreBundle/migrations/Version20260331122339.php b/src/Bundle/ChillDocStoreBundle/migrations/Version20260331122339.php index 58cc9fff6..450e4436d 100644 --- a/src/Bundle/ChillDocStoreBundle/migrations/Version20260331122339.php +++ b/src/Bundle/ChillDocStoreBundle/migrations/Version20260331122339.php @@ -37,7 +37,7 @@ final class Version20260331122339 extends AbstractMigration $this->addSql('CREATE INDEX IDX_A4353741F52905D0 ON chill_doc.stored_object_lock_user (storedobjectlock_uuid)'); $this->addSql('CREATE INDEX IDX_A4353741A76ED395 ON chill_doc.stored_object_lock_user (user_id)'); $this->addSql('COMMENT ON COLUMN chill_doc.stored_object_lock_user.storedobjectlock_uuid IS \'(DC2Type:uuid)\''); - $this->addSql('ALTER TABLE chill_doc.stored_object_lock_user ADD CONSTRAINT FK_A4353741F52905D0 FOREIGN KEY (storedobjectlock_uuid) REFERENCES chill_doc.stored_object_lock (uuid) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE chill_doc.stored_object_lock_user ADD CONSTRAINT FK_A4353741F52905D0 FOREIGN KEY (storedobjectlock_uuid) REFERENCES chill_doc.stored_object_lock (uuid) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE chill_doc.stored_object_lock_user ADD CONSTRAINT FK_A4353741A76ED395 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); }