fix: enforce SCADA chart device coverage

This commit is contained in:
2026-11-12 10:38:55 +08:00
parent b853b61a0b
commit 2e8fe86f3f
17 changed files with 1220 additions and 13 deletions
@@ -0,0 +1,14 @@
-- 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;