Files
mtusi2026lab5/migrations/006_pipeline_versions.sql
T
dawudukandCursor cf9d9a918f Добавить версионированный pipeline и проверку идемпотентности.
Трек 2 фиксирует дубль, устаревшую версию, падение до и после записи объекта и replay без второй копии результата.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-09 01:23:49 +03:00

15 lines
534 B
SQL

-- The served result is one pipeline version. An older job must not replace it.
-- Variant rows stay addressable per version; the attachment points at the winner.
ALTER TABLE attachments
ADD COLUMN applied_pipeline_version INTEGER NOT NULL DEFAULT 1
CHECK (applied_pipeline_version >= 1);
CREATE TABLE pipeline_faults (
id INTEGER PRIMARY KEY,
mode TEXT NOT NULL DEFAULT '',
remaining INTEGER NOT NULL DEFAULT 0 CHECK (remaining >= 0)
);
INSERT INTO pipeline_faults (id, mode, remaining) VALUES (1, '', 0);