fabrica

hanna/fabrica

497 bytes
Raw
1-- Bookmarks (stars): a user marking a repository. Public on the user's profile,
2-- filtered by the viewer's read access when listed.
3CREATE TABLE bookmarks (
4 id TEXT PRIMARY KEY,
5 user_id TEXT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
6 repo_id TEXT NOT NULL REFERENCES repos(id) ON DELETE CASCADE,
7 created_at BIGINT NOT NULL
8);
9CREATE UNIQUE INDEX idx_bookmarks_user_repo ON bookmarks (user_id, repo_id);
10CREATE INDEX idx_bookmarks_repo ON bookmarks (repo_id);