lab5 done
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE attachment_jobs (
|
||||
id uuid PRIMARY KEY,
|
||||
attachment_id uuid NOT NULL UNIQUE REFERENCES attachments(id),
|
||||
pipeline_version integer NOT NULL DEFAULT 1,
|
||||
state text NOT NULL CHECK (state IN ('queued','processing','ready','failed')),
|
||||
attempts integer NOT NULL DEFAULT 0,
|
||||
max_attempts integer NOT NULL CHECK (max_attempts BETWEEN 1 AND 20),
|
||||
available_at timestamptz NOT NULL DEFAULT clock_timestamp(),
|
||||
lease_until timestamptz,
|
||||
fence bigint NOT NULL DEFAULT 0,
|
||||
last_error text,
|
||||
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
|
||||
updated_at timestamptz NOT NULL DEFAULT clock_timestamp()
|
||||
);
|
||||
|
||||
-- +goose Down
|
||||
DROP TABLE attachment_jobs;
|
||||
Reference in New Issue
Block a user