Files
mtusi2026lab6/service/migrations/009_variant_manifest.sql
T
2026-11-17 13:08:13 +03:00

9 lines
421 B
SQL

CREATE TABLE attachment_variants (
attachment_id uuid NOT NULL REFERENCES attachments(id), pipeline_version integer NOT NULL,
variant text NOT NULL CHECK(variant IN ('original','thumbnail','crop','optimized')),
object_key text NOT NULL UNIQUE, sha256 text NOT NULL, size_bytes bigint NOT NULL,
PRIMARY KEY(attachment_id,pipeline_version,variant)
);
---- create above / drop below ----
DROP TABLE attachment_variants;