refactor(db): use int for attachment size and add lookup query

This commit is contained in:
kk10
2026-11-02 21:16:58 +03:00
parent 45c9f7731d
commit 983bbaa55e
9 changed files with 49 additions and 16 deletions
+5 -1
View File
@@ -18,7 +18,7 @@ SELECT
sqlc.arg(s3_key)::text,
sqlc.arg(filename)::text,
sqlc.arg(content_type)::text,
sqlc.arg(size_bytes)::bigint,
sqlc.arg(size_bytes)::int,
sqlc.arg(sha256)::text,
sqlc.arg(status)::text,
sqlc.arg(error_code)::text
@@ -40,6 +40,10 @@ INSERT INTO message_attachments (
sqlc.arg(position)
);
-- name: GetAttachmentByID :one
SELECT * FROM attachments
WHERE id = $1::uuid;
-- name: ListAttachmentsByIDs :many
SELECT status
FROM attachments