From bdd0a2c5642610d5425e474b55a1139028d954b5 Mon Sep 17 00:00:00 2001 From: Lukas Lohoff Date: Wed, 6 Nov 2024 13:35:35 +0100 Subject: [PATCH 1/2] chore: add unique constaints for authProviderId --- .../migration/V0.15.0__Add_AuthProviderId_Constraints.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 shogun-boot/src/main/resources/db/migration/V0.15.0__Add_AuthProviderId_Constraints.sql diff --git a/shogun-boot/src/main/resources/db/migration/V0.15.0__Add_AuthProviderId_Constraints.sql b/shogun-boot/src/main/resources/db/migration/V0.15.0__Add_AuthProviderId_Constraints.sql new file mode 100644 index 00000000..e4d35c32 --- /dev/null +++ b/shogun-boot/src/main/resources/db/migration/V0.15.0__Add_AuthProviderId_Constraints.sql @@ -0,0 +1,7 @@ +ALTER TABLE shogun.users +DROP CONSTRAINT IF EXISTS users_unique_auth_provider_id, +ADD CONSTRAINT users_unique_auth_provider_id UNIQUE (auth_provider_id); + +ALTER TABLE shogun.groups +DROP CONSTRAINT IF EXISTS groups_unique_auth_provider_id, +ADD CONSTRAINT groups_unique_auth_provider_id UNIQUE (auth_provider_id); \ No newline at end of file From 8d02c2fd66a34746360d1083fa7504fe6df2f151 Mon Sep 17 00:00:00 2001 From: Lukas Lohoff Date: Wed, 6 Nov 2024 13:39:20 +0100 Subject: [PATCH 2/2] chore: add missing newline --- .../db/migration/V0.15.0__Add_AuthProviderId_Constraints.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shogun-boot/src/main/resources/db/migration/V0.15.0__Add_AuthProviderId_Constraints.sql b/shogun-boot/src/main/resources/db/migration/V0.15.0__Add_AuthProviderId_Constraints.sql index e4d35c32..e11a90d2 100644 --- a/shogun-boot/src/main/resources/db/migration/V0.15.0__Add_AuthProviderId_Constraints.sql +++ b/shogun-boot/src/main/resources/db/migration/V0.15.0__Add_AuthProviderId_Constraints.sql @@ -4,4 +4,4 @@ ADD CONSTRAINT users_unique_auth_provider_id UNIQUE (auth_provider_id); ALTER TABLE shogun.groups DROP CONSTRAINT IF EXISTS groups_unique_auth_provider_id, -ADD CONSTRAINT groups_unique_auth_provider_id UNIQUE (auth_provider_id); \ No newline at end of file +ADD CONSTRAINT groups_unique_auth_provider_id UNIQUE (auth_provider_id);