-- Bookmarks (stars): a user marking a repository. Public on the user's profile,
-- filtered by the viewer's read access when listed.
CREATE TABLE bookmarks (
    id         TEXT PRIMARY KEY,
    user_id    TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    repo_id    TEXT NOT NULL REFERENCES repos(id) ON DELETE CASCADE,
    created_at BIGINT NOT NULL
);
CREATE UNIQUE INDEX idx_bookmarks_user_repo ON bookmarks (user_id, repo_id);
CREATE INDEX idx_bookmarks_repo ON bookmarks (repo_id);
