Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history

0032_repo_rulesets.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.

0032_repo_rulesets.sqlBlame36 lines · 2 contributors
9ff7128Claude1-- Block J6 — Repository rulesets.
2--
3-- Extends the legacy branch_protection table with a policy engine that can
4-- scope rules at the repo (v1) or org level (future). Each ruleset groups
5-- N rules; an evaluator short-circuits on enforcement=active with block=true
6-- and merely logs when enforcement=evaluate.
7
8CREATE TABLE IF NOT EXISTS "repo_rulesets" (
9 "id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
10 "repository_id" uuid NOT NULL REFERENCES "repositories"("id") ON DELETE CASCADE,
11 "name" text NOT NULL,
12 "enforcement" text NOT NULL DEFAULT 'active', -- 'active' | 'evaluate' | 'disabled'
13 "created_by" uuid REFERENCES "users"("id") ON DELETE SET NULL,
14 "created_at" timestamp NOT NULL DEFAULT now(),
15 "updated_at" timestamp NOT NULL DEFAULT now()
16);
13e7ee3Dictation App17--> statement-breakpoint
9ff7128Claude18
19CREATE INDEX IF NOT EXISTS "repo_rulesets_repo_idx"
20 ON "repo_rulesets" ("repository_id");
13e7ee3Dictation App21--> statement-breakpoint
9ff7128Claude22CREATE UNIQUE INDEX IF NOT EXISTS "repo_rulesets_repo_name_unique"
23 ON "repo_rulesets" ("repository_id", "name");
13e7ee3Dictation App24--> statement-breakpoint
9ff7128Claude25
26CREATE TABLE IF NOT EXISTS "ruleset_rules" (
27 "id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
28 "ruleset_id" uuid NOT NULL REFERENCES "repo_rulesets"("id") ON DELETE CASCADE,
29 "rule_type" text NOT NULL,
30 "params" text NOT NULL DEFAULT '{}', -- JSON
31 "created_at" timestamp NOT NULL DEFAULT now()
32);
13e7ee3Dictation App33--> statement-breakpoint
9ff7128Claude34
35CREATE INDEX IF NOT EXISTS "ruleset_rules_set_idx"
36 ON "ruleset_rules" ("ruleset_id");