Files
mtusi2026lab7/migrations/004_jobs.sql
T
SashaKirupina 7fb93b31ba
Skeleton contracts / contracts (pull_request) Canceled after 0s
ЛР 7 — БПИ2304 — Кирюпина — на 3
2026-11-28 00:31:13 +03:00

11 lines
602 B
SQL

ALTER TABLE attachments ADD COLUMN status text NOT NULL DEFAULT 'ready'
CHECK (status IN ('queued','processing','ready','failed'));
ALTER TABLE attachments ADD COLUMN error_code text;
ALTER TABLE attachments ADD COLUMN variants jsonb NOT NULL DEFAULT '[]';
ALTER TABLE attachments ADD COLUMN staging_key text;
CREATE TABLE attachment_jobs (
id uuid PRIMARY KEY, attachment_id uuid NOT NULL UNIQUE REFERENCES attachments(id),
pipeline_version integer NOT NULL DEFAULT 1 CHECK (pipeline_version=1),
attempts integer NOT NULL DEFAULT 0, created_at timestamptz(3) NOT NULL DEFAULT clock_timestamp()
);