From 811e8609654e9481177328d49060af7c07653a8a Mon Sep 17 00:00:00 2001 From: k4rli Date: Mon, 25 Aug 2025 11:51:27 +0300 Subject: [PATCH] feat(MED-85): fix delete company account error --- .../20250825072326_account_membership_id_for_audit.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 supabase/migrations/20250825072326_account_membership_id_for_audit.sql diff --git a/supabase/migrations/20250825072326_account_membership_id_for_audit.sql b/supabase/migrations/20250825072326_account_membership_id_for_audit.sql new file mode 100644 index 0000000..46d11b6 --- /dev/null +++ b/supabase/migrations/20250825072326_account_membership_id_for_audit.sql @@ -0,0 +1,5 @@ +-- user_id+account_id primary key -> separate id column for audit +ALTER TABLE medreport.accounts_memberships DROP CONSTRAINT accounts_memberships_pkey; +ALTER TABLE medreport.accounts_memberships ADD COLUMN id UUID DEFAULT gen_random_uuid(); +ALTER TABLE medreport.accounts_memberships ADD CONSTRAINT accounts_memberships_pkey PRIMARY KEY (id); +ALTER TABLE medreport.accounts_memberships ADD CONSTRAINT unique_user_account UNIQUE (user_id, account_id);