chore: add lab5 files and merge env.example.

This commit is contained in:
Голиков Maximillian Антон
2026-11-14 16:12:32 +03:00
parent 470d9d6f1e
commit 0d1a4261f8
93 changed files with 7085 additions and 11 deletions
+26
View File
@@ -0,0 +1,26 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE attachment_variants (
attachment_id UUID NOT NULL REFERENCES attachments(id) ON DELETE CASCADE,
name TEXT NOT NULL,
object_key TEXT NOT NULL,
content_type TEXT NOT NULL,
size_bytes BIGINT NOT NULL,
width INT NOT NULL,
height INT NOT NULL,
sha256 BYTEA NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
CONSTRAINT attachment_variants_pkey PRIMARY KEY (attachment_id, name),
CONSTRAINT attachment_variants_name_chk CHECK (name IN ('thumbnail', 'crop', 'optimized')),
CONSTRAINT attachment_variants_size_chk CHECK (size_bytes > 0),
CONSTRAINT attachment_variants_sha256_len CHECK (octet_length(sha256) = 32)
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE IF EXISTS attachment_variants;
-- +goose StatementEnd