Loading
feat(datastore): OCI container schema (S12 Step 1)
Why
First implementation MR for S12 — Container/OCI Local, Step 1 of the plan: the six container_* schema tables (container_repositories, container_images, container_blobs, container_manifests, container_manifest_relationships, container_tags) plus integration tests. Subsequent steps wire datastore methods and HTTP handlers.
Work item: #19 (closed). The container_blobs.blob_sha256 and container_manifests.blob_sha256 FKs to blob_storage_blobs are deferred to S06 Step 6 (blob_storage_blobs is not yet on main), following the !276 (merged) precedent.
Context for LLM agents
Rationale
- IDENTITY columns vs explicit sequence: chose
DEFAULT nextval('<table>_id_seq')to match the existing pattern (blob_storage_attachments, repositories) and ADR-007's blob-storage form. Schema-shape tests lock the choice in so a future revert to IDENTITY does not slip through. - Defensive
octet_length = 32CHECKs on every digest/sha256 column. The spec now declares them inline to match.
Non-goals
- Application code reading or writing the new tables. Lands in S12 Steps 2-4.
- Soft-delete, lifecycle, GC. Plan defers to S20.
- Repository and image size accounting. Plan defers to S22.
- Partition-routing live-INSERT tests for the four leaf tables. Declaration + 64-partition-count tests catch the realistic bug classes. Routing is exercised end-to-end in Steps 2-4 via datastore methods.