CREATE TABLE IF NOT EXISTS project_watch (
    id BIGSERIAL PRIMARY KEY,
    project UUID NOT NULL,
    "user" UUID NOT NULL,
    notifications_enabled BOOLEAN NOT NULL DEFAULT true,
    created_at TIMESTAMPTZ NOT NULL,
    updated_at TIMESTAMPTZ NOT NULL,
    UNIQUE (project, "user")
);

CREATE UNIQUE INDEX idx_project_watch_project_user ON project_watch (project, "user");
