refactor(db): align project template schema

This commit is contained in:
2026-08-03 10:39:31 +08:00
parent 0be31869b5
commit f010f071eb
9 changed files with 25 additions and 132 deletions
@@ -0,0 +1,17 @@
-- [LEAKAGE_IDENTIFY_RESULT]
-- 存储漏损识别任务的结果数据。
CREATE TABLE leakage_identify_result (
id BIGSERIAL PRIMARY KEY,
scheme_name varchar NOT NULL,
network varchar NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
run_status varchar NOT NULL DEFAULT 'completed',
error_message text,
sensor_nodes jsonb NOT NULL DEFAULT '[]'::jsonb,
result_rows jsonb NOT NULL DEFAULT '[]'::jsonb,
node_area_map jsonb NOT NULL DEFAULT '{}'::jsonb,
areas jsonb DEFAULT '[]'::jsonb,
drawing_payload jsonb DEFAULT '{"type": "FeatureCollection", "features": []}'::jsonb,
CONSTRAINT uq_leakage_identify_result_scheme UNIQUE (scheme_name)
);