-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for the referrers api (oci compliance tests fully passing) (#397
) * change how manifests are handled: * before: they were special blobs * now: they're a different object in the DB, not written on disk * compute digest on AsyncRead instead of blocking * add referrers API endpoint (very basic, no pagination)
- Loading branch information
Showing
20 changed files
with
544 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,28 @@ | ||
CREATE TABLE "blob" ( | ||
"digest" varchar NOT NULL PRIMARY KEY, | ||
"size" integer NOT NULL, | ||
"is_manifest" boolean NOT NULL, | ||
"last_accessed" integer NOT NULL DEFAULT (unixepoch()) | ||
); | ||
CREATE TABLE "blob_blob_association" ( | ||
"parent_digest" varchar NOT NULL, | ||
"child_digest" varchar NOT NULL, | ||
PRIMARY KEY ("parent_digest", "child_digest"), | ||
FOREIGN KEY ("parent_digest") | ||
REFERENCES "blob" ("digest") | ||
ON DELETE CASCADE | ||
ON UPDATE CASCADE, | ||
FOREIGN KEY ("child_digest") | ||
REFERENCES "blob" ("digest") | ||
); | ||
"digest" TEXT NOT NULL PRIMARY KEY, | ||
"size" INTEGER NOT NULL, | ||
"last_accessed" INTEGER NOT NULL DEFAULT (unixepoch()) | ||
) STRICT; | ||
CREATE TABLE "manifest" ( | ||
"digest" TEXT NOT NULL PRIMARY KEY, | ||
"last_accessed" INTEGER NOT NULL DEFAULT (unixepoch()), | ||
"json" BLOB NOT NULL, | ||
"blob" BLOB NOT NULL | ||
) STRICT; | ||
CREATE TABLE "blob_upload" ( | ||
"uuid" TEXT NOT NULL PRIMARY KEY, | ||
"offset" integer NOT NULL, | ||
"updated_at" timestamp_text NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"repo" varchar NOT NULL | ||
); | ||
"offset" INTEGER NOT NULL, | ||
"updated_at" TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"repo" TEXT NOT NULL | ||
) STRICT; | ||
CREATE TABLE "repo_blob_association" ( | ||
"repo_name" varchar NOT NULL, | ||
"blob_digest" varchar NOT NULL, | ||
PRIMARY KEY ("repo_name", "blob_digest"), | ||
FOREIGN KEY ("blob_digest") | ||
REFERENCES "blob" ("digest") | ||
ON DELETE CASCADE | ||
); | ||
"repo_name" TEXT NOT NULL, | ||
"blob_digest" TEXT NOT NULL, | ||
PRIMARY KEY ("repo_name", "blob_digest") | ||
) STRICT; | ||
CREATE TABLE "tag" ( | ||
"tag" varchar NOT NULL, | ||
"repo" varchar NOT NULL, | ||
"manifest_digest" varchar NOT NULL, | ||
CONSTRAINT "IDX_repo_tag" PRIMARY KEY ("repo", "tag"), | ||
FOREIGN KEY ("repo", "manifest_digest") | ||
REFERENCES "repo_blob_association" ("repo_name", "blob_digest") | ||
ON DELETE CASCADE | ||
); | ||
"tag" TEXT NOT NULL, | ||
"repo" TEXT NOT NULL, | ||
"manifest_digest" TEXT NOT NULL, | ||
CONSTRAINT "IDX_repo_tag" PRIMARY KEY ("repo", "tag") | ||
) STRICT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.