create table if not exists project_members ( id bigserial primary key, project_uuid uuid not null, user_uuid uuid not null, scope varchar(255) not null, joined_at timestamp with time zone not null, unique (project_uuid, user_uuid) ); create unique index if not exists idx_project_members_project_user on project_members (project_uuid, user_uuid);