Files
mtusi2026lab7/migrations/004_jobs.sql
T
2026-12-03 19:25:38 +03:00

8 lines
401 B
SQL

ALTER TABLE attachments ADD COLUMN IF NOT EXISTS variants jsonb NOT NULL DEFAULT '[]';
ALTER TABLE attachments ADD COLUMN IF NOT EXISTS error_code text;
CREATE TABLE IF NOT EXISTS jobs (
id uuid PRIMARY KEY, attachment_id uuid UNIQUE NOT NULL REFERENCES attachments(id),
attempt integer NOT NULL DEFAULT 1, created_at timestamptz NOT NULL DEFAULT now(),
published boolean NOT NULL DEFAULT false
);