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

0025_code_symbols.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.

0025_code_symbols.sqlBlame31 lines · 1 contributor
4c8f666Claude1-- Gluecron migration 0025: Code symbol index.
2--
3-- I8 — Symbol / xref navigation. Stores top-level symbol definitions
4-- (functions, classes, interfaces, types, consts) extracted from a
5-- repository's HEAD via a regex-based parser. References are found at
6-- lookup-time by grepping content, so we only persist definitions.
7--
8-- On-demand index: owner clicks "Reindex" on /:owner/:repo/symbols. We
9-- keep only the most recent commit's symbols — older rows are overwritten
10-- by deleting the prior set before inserting the new one.
11
12--> statement-breakpoint
13CREATE TABLE IF NOT EXISTS "code_symbols" (
14 "id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
15 "repository_id" uuid NOT NULL REFERENCES "repositories"("id") ON DELETE CASCADE,
16 "commit_sha" text NOT NULL,
17 "name" text NOT NULL,
18 "kind" text NOT NULL,
19 "path" text NOT NULL,
20 "line" integer NOT NULL,
21 "signature" text,
22 "created_at" timestamp NOT NULL DEFAULT now()
23);
24
25--> statement-breakpoint
26CREATE INDEX IF NOT EXISTS "code_symbols_repo_name_idx"
27 ON "code_symbols" ("repository_id", "name");
28
29--> statement-breakpoint
30CREATE INDEX IF NOT EXISTS "code_symbols_repo_path_idx"
31 ON "code_symbols" ("repository_id", "path");