Files
expenses/server/migrations/20260918000001_create_account_members.sql
T
2026-10-11 10:00:04 +02:00

7 lines
360 B
SQL

CREATE TABLE account_members (
id UUID DEFAULT gen_random_uuid (),
account_id UUID NOT NULL CONSTRAINT fk_account_members_account REFERENCES accounts (id),
user_id UUID NOT NULL CONSTRAINT fk_account_members_user REFERENCES users (id),
PRIMARY KEY (id, account_id),
CONSTRAINT uq_account_members_account_user UNIQUE (account_id, user_id)
);