feat(jobs/runners): attachment cleanup + chat DeleteAttachments query/method

This commit is contained in:
2026-05-06 08:07:49 +08:00
parent c50621eeca
commit f56fe449fd
7 changed files with 193 additions and 0 deletions
+9
View File
@@ -34,6 +34,15 @@ func (q *Queries) DeleteAttachment(ctx context.Context, id pgtype.UUID) error {
return err
}
const deleteAttachmentsByIDs = `-- name: DeleteAttachmentsByIDs :exec
DELETE FROM message_attachments WHERE id = ANY($1::uuid[])
`
func (q *Queries) DeleteAttachmentsByIDs(ctx context.Context, dollar_1 []pgtype.UUID) error {
_, err := q.db.Exec(ctx, deleteAttachmentsByIDs, dollar_1)
return err
}
const getAttachment = `-- name: GetAttachment :one
SELECT id, user_id, message_id, filename, mime_type, size_bytes, sha256, storage_path, created_at FROM message_attachments WHERE id = $1
`