Files
next-tjwater-server/resources/sql/035_scada_presentation_coverage.sql
T

15 lines
811 B
PL/PgSQL

-- Run-scoped artifact facts survive domain-event retention without a new lifecycle table.
BEGIN;
SET LOCAL lock_timeout = '5s';
ALTER TABLE workbench.operational_task_runs
ADD COLUMN IF NOT EXISTS artifact_manifest jsonb NOT NULL DEFAULT '{}'::jsonb;
ALTER TABLE workbench.operational_task_runs
DROP CONSTRAINT IF EXISTS operational_task_runs_artifact_manifest_object;
ALTER TABLE workbench.operational_task_runs
ADD CONSTRAINT operational_task_runs_artifact_manifest_object
CHECK (jsonb_typeof(artifact_manifest) = 'object');
COMMENT ON COLUMN workbench.operational_task_runs.artifact_manifest IS
'Server-verified per-run artifact facts. scada_presentation holds cumulative targets and latest chart coverage, independent of browser receipts and event retention; not run status.';
COMMIT;