From 20e78878a85ffda19495622d02ebfbe476fbfabb Mon Sep 17 00:00:00 2001 From: Joonas Javanainen Date: Tue, 3 Dec 2024 18:42:32 +0200 Subject: [PATCH] Cascade person delete to citizen_user --- .../db/migration/V470__cascade_citizen_user_delete.sql | 3 +++ service/src/main/resources/migrations.txt | 1 + 2 files changed, 4 insertions(+) create mode 100644 service/src/main/resources/db/migration/V470__cascade_citizen_user_delete.sql diff --git a/service/src/main/resources/db/migration/V470__cascade_citizen_user_delete.sql b/service/src/main/resources/db/migration/V470__cascade_citizen_user_delete.sql new file mode 100644 index 0000000000..cf3d85b020 --- /dev/null +++ b/service/src/main/resources/db/migration/V470__cascade_citizen_user_delete.sql @@ -0,0 +1,3 @@ +ALTER TABLE citizen_user + DROP CONSTRAINT fk$person, + ADD CONSTRAINT fk$person FOREIGN KEY (id) REFERENCES person (id) ON DELETE CASCADE; diff --git a/service/src/main/resources/migrations.txt b/service/src/main/resources/migrations.txt index 19efde4485..8fbf594179 100644 --- a/service/src/main/resources/migrations.txt +++ b/service/src/main/resources/migrations.txt @@ -465,3 +465,4 @@ V466__push_notification_calendar_event_reservation.sql V467__push_notification_calendar_event_reservation_defaults.sql V468__citizen_user.sql V469__income_statement_status.sql +V470__cascade_citizen_user_delete.sql