-- 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);