From d4a7a9046afb9c96dbd7df41385b7cd71e01d9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Ciarcin=CC=81ski?= Date: Tue, 12 Nov 2024 12:54:27 +0100 Subject: [PATCH] Add migration to make openid_sub unique --- migrations/20241112105513_openid_sub_unique.down.sql | 1 + migrations/20241112105513_openid_sub_unique.up.sql | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 migrations/20241112105513_openid_sub_unique.down.sql create mode 100644 migrations/20241112105513_openid_sub_unique.up.sql diff --git a/migrations/20241112105513_openid_sub_unique.down.sql b/migrations/20241112105513_openid_sub_unique.down.sql new file mode 100644 index 000000000..68e67ce02 --- /dev/null +++ b/migrations/20241112105513_openid_sub_unique.down.sql @@ -0,0 +1 @@ +ALTER TABLE "user" DROP CONSTRAINT "user_openid_sub_key"; diff --git a/migrations/20241112105513_openid_sub_unique.up.sql b/migrations/20241112105513_openid_sub_unique.up.sql new file mode 100644 index 000000000..40e6e1f5d --- /dev/null +++ b/migrations/20241112105513_openid_sub_unique.up.sql @@ -0,0 +1,3 @@ +-- Make openid_sub unique. +-- This migration may fail if duplicate openid_subs exist in the database. +ALTER TABLE "user" ADD CONSTRAINT "user_openid_sub_key" UNIQUE (openid_sub);