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 TIMESTAMPTZ NOT NULL,
    UNIQUE (project_uuid, user_uuid)
);

CREATE UNIQUE INDEX idx_project_members_project_user ON project_members (project_uuid, user_uuid);
