Tahinli/forge
public0 watching
★ 0
| 1 | -- Stars: a user's bookmark on a repo. A row goes with either the user or the repo. |
| 2 | -- The primary key serves "repos starred by a user"; the index serves the per-repo count. |
| 3 | |
| 4 | ( |
| 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 TEXT NOT NULL, |
| 8 | PRIMARY KEY (user_id, repo_id)); |
| 9 | ON stars(repo_id); |