From 51273d820aefbd43943216b8e41b26f058a689d4 Mon Sep 17 00:00:00 2001 From: Sacha Al Himdani Date: Fri, 3 Oct 2025 12:30:09 +0200 Subject: [PATCH] Fix asset owner deletion Signed-off-by: Sacha Al Himdani --- pkg/coredata/migrations/20251003T102644Z.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 pkg/coredata/migrations/20251003T102644Z.sql diff --git a/pkg/coredata/migrations/20251003T102644Z.sql b/pkg/coredata/migrations/20251003T102644Z.sql new file mode 100644 index 000000000..6c98c6d69 --- /dev/null +++ b/pkg/coredata/migrations/20251003T102644Z.sql @@ -0,0 +1,6 @@ +ALTER TABLE assets DROP CONSTRAINT assets_owner_id_fkey; +ALTER TABLE assets ADD CONSTRAINT assets_owner_id_fkey + FOREIGN KEY (owner_id) + REFERENCES peoples(id) + ON UPDATE CASCADE + ON DELETE RESTRICT;