feat(MED-85): fix delete company account error

This commit is contained in:
2025-08-25 11:51:27 +03:00
parent 89d6035151
commit 811e860965

View File

@@ -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);