CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history
0033_commit_statuses.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.
| 0cdfd89 | 1 | -- Block J8 — Commit statuses (GitHub-parity external CI signal). |
| 2 | -- | |
| 3 | -- External systems post per-commit (sha, context) statuses that appear on | |
| 4 | -- commit detail views and fuel future merge-gating. Per (repo, sha, context) | |
| 5 | -- upsert semantics — a repost with the same context replaces the prior row. | |
| 6 | ||
| 7 | CREATE TABLE IF NOT EXISTS "commit_statuses" ( | |
| 8 | "id" uuid PRIMARY KEY DEFAULT gen_random_uuid(), | |
| 9 | "repository_id" uuid NOT NULL REFERENCES "repositories"("id") ON DELETE CASCADE, | |
| 10 | "commit_sha" text NOT NULL, | |
| 11 | "state" text NOT NULL, -- 'pending' | 'success' | 'failure' | 'error' | |
| 12 | "context" text NOT NULL DEFAULT 'default', | |
| 13 | "description" text, | |
| 14 | "target_url" text, | |
| 15 | "creator_id" uuid REFERENCES "users"("id") ON DELETE SET NULL, | |
| 16 | "created_at" timestamp NOT NULL DEFAULT now(), | |
| 17 | "updated_at" timestamp NOT NULL DEFAULT now() | |
| 18 | ); | |
| 13e7ee3 | 19 | --> statement-breakpoint |
| 0cdfd89 | 20 | |
| 21 | CREATE UNIQUE INDEX IF NOT EXISTS "commit_statuses_repo_sha_context_unique" | |
| 22 | ON "commit_statuses" ("repository_id", "commit_sha", "context"); | |
| 13e7ee3 | 23 | --> statement-breakpoint |
| 0cdfd89 | 24 | |
| 25 | CREATE INDEX IF NOT EXISTS "commit_statuses_repo_sha_idx" | |
| 26 | ON "commit_statuses" ("repository_id", "commit_sha"); |