Implement durable image processing pipeline with outbox and recovery
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
CREATE TABLE attachment_job_replays (
|
||||
id UUID PRIMARY KEY,
|
||||
job_id UUID NOT NULL REFERENCES attachment_jobs(id),
|
||||
actor TEXT NOT NULL CHECK (char_length(actor) BETWEEN 1 AND 100),
|
||||
reason TEXT NOT NULL CHECK (char_length(reason) BETWEEN 1 AND 500),
|
||||
previous_attempt INTEGER NOT NULL CHECK (previous_attempt >= 1),
|
||||
new_attempt INTEGER NOT NULL,
|
||||
previous_error_code TEXT NOT NULL,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT clock_timestamp(),
|
||||
|
||||
CHECK (new_attempt = previous_attempt + 1),
|
||||
UNIQUE (job_id, new_attempt)
|
||||
);
|
||||
Reference in New Issue
Block a user