From 3c6d537b5ed682fdd42fe6506bc836e553733777 Mon Sep 17 00:00:00 2001 From: rmiccoli Date: Mon, 6 Nov 2023 12:29:09 +0100 Subject: [PATCH] Fix V96 foreign keys migration --- .../main/resources/db/migration/h2/V96__add_foreign_keys.sql | 2 +- .../main/resources/db/migration/mysql/V96__add_foreign_keys.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iam-persistence/src/main/resources/db/migration/h2/V96__add_foreign_keys.sql b/iam-persistence/src/main/resources/db/migration/h2/V96__add_foreign_keys.sql index 9eceda90d..3b55858aa 100644 --- a/iam-persistence/src/main/resources/db/migration/h2/V96__add_foreign_keys.sql +++ b/iam-persistence/src/main/resources/db/migration/h2/V96__add_foreign_keys.sql @@ -90,7 +90,7 @@ ALTER TABLE authorization_code ADD CONSTRAINT FK_authorization_code_auth_holder_ -- APPROVED SITE -DELETE FROM approved_site WHERE client_id NOT IN (SELECT id FROM client_details); +DELETE FROM approved_site WHERE client_id NOT IN (SELECT client_id FROM client_details); ALTER TABLE approved_site ADD CONSTRAINT FK_approved_site_client_id FOREIGN KEY (client_id) REFERENCES client_details (client_id) ON UPDATE CASCADE ON DELETE CASCADE; DELETE FROM approved_site_scope WHERE owner_id NOT IN (SELECT id FROM approved_site); diff --git a/iam-persistence/src/main/resources/db/migration/mysql/V96__add_foreign_keys.sql b/iam-persistence/src/main/resources/db/migration/mysql/V96__add_foreign_keys.sql index 7604a7fe2..0ecaaa8f6 100644 --- a/iam-persistence/src/main/resources/db/migration/mysql/V96__add_foreign_keys.sql +++ b/iam-persistence/src/main/resources/db/migration/mysql/V96__add_foreign_keys.sql @@ -90,7 +90,7 @@ ALTER TABLE authorization_code ADD CONSTRAINT FK_authorization_code_auth_holder_ -- APPROVED SITE -DELETE FROM approved_site WHERE client_id NOT IN (SELECT id FROM client_details); +DELETE FROM approved_site WHERE client_id NOT IN (SELECT client_id FROM client_details); ALTER TABLE approved_site ADD CONSTRAINT FK_approved_site_client_id FOREIGN KEY (client_id) REFERENCES client_details (client_id) ON UPDATE CASCADE ON DELETE CASCADE; DELETE FROM approved_site_scope WHERE owner_id NOT IN (SELECT id FROM approved_site);