CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history
0109_pending_reviews.sql
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| a2c10c5 | 1 | -- Pending review drafts — inline comments staged before a reviewer submits. |
| 2 | -- One pending_review row per (pr, author). Many pending_review_comments per review. | |
| 3 | CREATE TABLE IF NOT EXISTS pending_reviews ( | |
| 4 | id UUID PRIMARY KEY DEFAULT gen_random_uuid(), | |
| 5 | pr_id UUID NOT NULL REFERENCES pull_requests(id) ON DELETE CASCADE, | |
| 6 | author_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE, | |
| 7 | created_at TIMESTAMPTZ DEFAULT NOW(), | |
| 8 | UNIQUE (pr_id, author_id) | |
| 9 | ); | |
| 10 | ||
| 11 | CREATE TABLE IF NOT EXISTS pending_review_comments ( | |
| 12 | id UUID PRIMARY KEY DEFAULT gen_random_uuid(), | |
| 13 | review_id UUID NOT NULL REFERENCES pending_reviews(id) ON DELETE CASCADE, | |
| 14 | file_path TEXT NOT NULL, | |
| 15 | line_number INTEGER NOT NULL, | |
| 16 | body TEXT NOT NULL, | |
| 17 | created_at TIMESTAMPTZ DEFAULT NOW() | |
| 18 | ); | |
| 19 | ||
| 20 | CREATE INDEX IF NOT EXISTS idx_pending_reviews_pr ON pending_reviews(pr_id); | |
| 21 | CREATE INDEX IF NOT EXISTS idx_pending_reviews_author ON pending_reviews(pr_id, author_id); | |
| 22 | CREATE INDEX IF NOT EXISTS idx_pending_review_comments_review ON pending_review_comments(review_id); |