CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history
0028_repo_dependencies.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.
| 8098672 | 1 | -- Gluecron migration 0028: dependency graph. |
| 2 | -- | |
| 3 | -- J1 — Parses manifest files in a repo and stores a per-repo SBOM. | |
| 4 | -- `repo_dependencies` is a "last known state" set — each reindex REPLACES the | |
| 5 | -- prior rows. `ecosystem` is the package manager (npm, pypi, go, rubygems, | |
| 6 | -- cargo, composer). `manifest_path` is the file the dep came from. | |
| 7 | -- | |
| 8 | -- One row per (repository_id, ecosystem, name, manifest_path). We don't | |
| 9 | -- de-dup across manifests (the same dep can legitimately appear in multiple | |
| 10 | -- manifests, e.g. server + client package.json). | |
| 11 | ||
| 12 | --> statement-breakpoint | |
| 13 | CREATE TABLE IF NOT EXISTS "repo_dependencies" ( | |
| 14 | "id" uuid PRIMARY KEY DEFAULT gen_random_uuid(), | |
| 15 | "repository_id" uuid NOT NULL REFERENCES "repositories"("id") ON DELETE CASCADE, | |
| 16 | "ecosystem" text NOT NULL, -- npm | pypi | go | rubygems | cargo | composer | |
| 17 | "name" text NOT NULL, | |
| 18 | "version_spec" text, -- "^1.2.3", ">=2.0", "1.2.3" | |
| 19 | "manifest_path" text NOT NULL, -- "package.json", "frontend/package.json" | |
| 20 | "is_dev" boolean NOT NULL DEFAULT false, | |
| 21 | "commit_sha" text NOT NULL, -- commit the index was built against | |
| 22 | "indexed_at" timestamp NOT NULL DEFAULT now() | |
| 23 | ); | |
| 24 | ||
| 25 | --> statement-breakpoint | |
| 26 | CREATE INDEX IF NOT EXISTS "repo_dependencies_repo_id_idx" | |
| 27 | ON "repo_dependencies" ("repository_id", "ecosystem"); | |
| 28 | ||
| 29 | --> statement-breakpoint | |
| 30 | CREATE INDEX IF NOT EXISTS "repo_dependencies_name_idx" | |
| 31 | ON "repo_dependencies" ("name"); |