lab5 done

This commit is contained in:
Khakimov Dmitrij
2026-11-10 22:13:40 +03:00
parent b2bd7501d3
commit cbe9d8748c
63 changed files with 8907 additions and 307 deletions
+12
View File
@@ -0,0 +1,12 @@
-- +goose Up
-- Re-process accepted lab4 originals; original keys remain durable staging until ready.
INSERT INTO attachment_jobs(id,attachment_id,state,max_attempts)
SELECT id,id,'queued',5 FROM attachments WHERE status='ready' AND variants='[]'::jsonb;
UPDATE attachments SET staging_key=object_key,
object_key='original/'||id::text||'/v1/original',status='queued',updated_at=clock_timestamp()
WHERE id IN (SELECT attachment_id FROM attachment_jobs);
INSERT INTO attachment_outbox(job_id) SELECT id FROM attachment_jobs;
-- +goose Down
-- Do not erase accepted processing jobs during a downgrade. Schema Down is destructive.
SELECT 1;