Blame · Line-by-line history
0039_health_scores.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.
| a7361c0 | 1 | CREATE TABLE IF NOT EXISTS repo_health_scores ( |
| 2 | id UUID PRIMARY KEY DEFAULT gen_random_uuid(), | |
| 3 | repository_id UUID NOT NULL REFERENCES repositories(id) ON DELETE CASCADE, | |
| 4 | score INTEGER NOT NULL, -- 0–100 | |
| 5 | grade TEXT NOT NULL, -- "A" | "B" | "C" | "D" | "F" | |
| 6 | security_score INTEGER NOT NULL, -- 0–30 | |
| 7 | gates_score INTEGER NOT NULL, -- 0–25 | |
| 8 | ai_review_score INTEGER NOT NULL, -- 0–20 | |
| 9 | dependencies_score INTEGER NOT NULL, -- 0–15 | |
| 10 | code_quality_score INTEGER NOT NULL, -- 0–10 | |
| 11 | recommendations JSONB NOT NULL DEFAULT '[]', -- array of {category, message, priority: "high"|"medium"|"low"} | |
| 12 | issues_found JSONB NOT NULL DEFAULT '[]', -- array of {category, message, severity: "critical"|"high"|"medium"|"low"} | |
| 13 | computed_at TIMESTAMPTZ NOT NULL DEFAULT NOW() | |
| 14 | ); | |
| 15 | ||
| 16 | CREATE INDEX IF NOT EXISTS repo_health_scores_repo ON repo_health_scores(repository_id); | |
| 17 | CREATE INDEX IF NOT EXISTS repo_health_scores_computed ON repo_health_scores(computed_at DESC); |