Добавил TLS и защиту мессенджера для лабораторной 7
Skeleton contracts / contracts (pull_request) Blocked by required conditions
Skeleton contracts / contracts (pull_request) Blocked by required conditions
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
ALTER TABLE attachments
|
||||
DROP CONSTRAINT attachments_status_check,
|
||||
DROP CONSTRAINT attachments_variants_check,
|
||||
ADD COLUMN staging_key text,
|
||||
ADD CONSTRAINT attachments_status_check
|
||||
CHECK (status IN ('queued', 'processing', 'ready', 'failed')),
|
||||
ADD CONSTRAINT attachments_variants_check
|
||||
CHECK (jsonb_typeof(variants) = 'array');
|
||||
|
||||
CREATE TABLE attachment_jobs (
|
||||
id uuid PRIMARY KEY,
|
||||
attachment_id uuid NOT NULL UNIQUE REFERENCES attachments(id) ON DELETE CASCADE,
|
||||
pipeline_version integer NOT NULL DEFAULT 1 CHECK (pipeline_version >= 1),
|
||||
attempt integer NOT NULL DEFAULT 1 CHECK (attempt >= 1),
|
||||
state text NOT NULL DEFAULT 'queued'
|
||||
CHECK (state IN ('queued', 'processing', 'ready', 'failed')),
|
||||
available_at timestamptz NOT NULL DEFAULT now(),
|
||||
published_at timestamptz,
|
||||
error_code text,
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
updated_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
CREATE INDEX attachment_jobs_outbox_idx
|
||||
ON attachment_jobs (available_at, created_at)
|
||||
WHERE state = 'queued' AND published_at IS NULL;
|
||||
Reference in New Issue
Block a user