CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history
0084_oci_registry.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.
| 845fd8a | 1 | -- OCI / Docker container registry tables (Block OCI-1) |
| 2 | -- | |
| 3 | -- oci_repositories — image namespaces, one per (owner, name) pair. | |
| 4 | -- name is the full "owner/image" string as used in `docker push`. | |
| 5 | -- | |
| 6 | -- oci_tags — mutable tag → manifest-digest pointers, analogous to git refs. | |
| 7 | -- Each push that specifies a tag upserts the row so the tag always resolves | |
| 8 | -- to the most-recently-pushed manifest digest. | |
| 9 | -- | |
| 10 | -- Blob files live on disk at ${OCI_STORE_PATH}/blobs/sha256/<hex> and are | |
| 11 | -- referenced only by digest; no DB row is needed for individual blobs. | |
| 12 | ||
| 13 | CREATE TABLE IF NOT EXISTS oci_repositories ( | |
| 14 | id UUID PRIMARY KEY DEFAULT gen_random_uuid(), | |
| 15 | owner_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE, | |
| 16 | name TEXT NOT NULL, | |
| 17 | visibility TEXT NOT NULL DEFAULT 'private', | |
| 18 | created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), | |
| 19 | ||
| 20 | CONSTRAINT oci_repositories_owner_name UNIQUE (owner_id, name) | |
| 21 | ); | |
| 22 | ||
| 23 | CREATE INDEX IF NOT EXISTS idx_oci_repositories_owner ON oci_repositories (owner_id); | |
| 24 | ||
| 25 | CREATE TABLE IF NOT EXISTS oci_tags ( | |
| 26 | id UUID PRIMARY KEY DEFAULT gen_random_uuid(), | |
| 27 | repository_id UUID NOT NULL REFERENCES oci_repositories(id) ON DELETE CASCADE, | |
| 28 | tag TEXT NOT NULL, | |
| 29 | manifest_digest TEXT NOT NULL, | |
| 30 | created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), | |
| 31 | updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), | |
| 32 | ||
| 33 | CONSTRAINT oci_tags_repo_tag UNIQUE (repository_id, tag) | |
| 34 | ); | |
| 35 | ||
| 36 | CREATE INDEX IF NOT EXISTS idx_oci_tags_repo ON oci_tags (repository_id); |