Пунк Е загрузка вложений готово

This commit is contained in:
Dmitry
2026-11-10 23:57:31 +03:00
parent 034d5537cf
commit da12a510bc
17 changed files with 567 additions and 26 deletions
@@ -0,0 +1,17 @@
CREATE TABLE attachments (
id UUID PRIMARY KEY,
chat_id UUID NOT NULL REFERENCES chats(id) ON DELETE CASCADE,
uploader_id UUID NOT NULL REFERENCES users(id),
object_key VARCHAR(512) NOT NULL,
original_filename VARCHAR(255) NOT NULL,
content_type VARCHAR(128) NOT NULL,
size_bytes BIGINT NOT NULL CHECK (size_bytes > 0),
checksum_sha256 CHAR(64) NOT NULL,
width INT,
height INT,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
CONSTRAINT uq_attachments_object_key UNIQUE (object_key)
);
CREATE INDEX idx_attachments_chat_id ON attachments (chat_id);
CREATE INDEX idx_attachments_uploader_id ON attachments (uploader_id);