create table if not exists project_watch
(
    id                    bigserial
        primary key,
    project               uuid                     not null,
    "user"                uuid                     not null,
    notifications_enabled boolean default true     not null,
    created_at            timestamp with time zone not null,
    updated_at            timestamp with time zone not null,
    unique (project, "user")
);

create unique index if not exists idx_project_watch_project_user
    on project_watch (project, "user");
