From 291ac846c3f0a583082168784c2818347d8afae2 Mon Sep 17 00:00:00 2001 From: DingZQ Date: Wed, 23 Apr 2025 21:43:16 +0800 Subject: [PATCH] Add sensor_placement and burse_locate_result --- script/sql/create/42.sensor_placement.sql | 14 ++++++++++++++ script/sql/create/43.burst_locate_result.sql | 13 +++++++++++++ script/sql/drop/42.sensor_placement.sql | 6 ++++++ script/sql/drop/43.burst_locate_result.sql | 6 ++++++ 4 files changed, 39 insertions(+) create mode 100644 script/sql/create/42.sensor_placement.sql create mode 100644 script/sql/create/43.burst_locate_result.sql create mode 100644 script/sql/drop/42.sensor_placement.sql create mode 100644 script/sql/drop/43.burst_locate_result.sql diff --git a/script/sql/create/42.sensor_placement.sql b/script/sql/create/42.sensor_placement.sql new file mode 100644 index 0000000..5927dfe --- /dev/null +++ b/script/sql/create/42.sensor_placement.sql @@ -0,0 +1,14 @@ +-- [SENSOR_PLACEMENT] +-- 王名豪 +-- 2025/04/18 +-- 存储测压点的布置方案 + +CREATE TABLE sensor_placement ( + id SERIAL PRIMARY KEY, + scheme_name varchar(32) not null, + sensor_number int, + min_diameter int, + username varchar(32) not null REFERENCES "users"(username) ON UPDATE CASCADE ON DELETE RESTRICT, + create_time TIMESTAMP WITH TIME ZONE not null DEFAULT date_trunc('minute', CURRENT_TIMESTAMP), + sensor_location TEXT[] +); \ No newline at end of file diff --git a/script/sql/create/43.burst_locate_result.sql b/script/sql/create/43.burst_locate_result.sql new file mode 100644 index 0000000..ed03bb4 --- /dev/null +++ b/script/sql/create/43.burst_locate_result.sql @@ -0,0 +1,13 @@ +-- [BURST_LOCATE_RESULT] +-- 王名豪 +-- 2025/04/19 +-- 存储爆管侦测定位结果 + +CREATE TABLE burst_locate_result ( + id SERIAL PRIMARY KEY, + type varchar(32) not null, + burst_incident varchar(32) not null, + leakage float, + detect_time TIMESTAMP WITH TIME ZONE not null DEFAULT date_trunc('minute', CURRENT_TIMESTAMP), + locate_result JSON +) \ No newline at end of file diff --git a/script/sql/drop/42.sensor_placement.sql b/script/sql/drop/42.sensor_placement.sql new file mode 100644 index 0000000..5fa5961 --- /dev/null +++ b/script/sql/drop/42.sensor_placement.sql @@ -0,0 +1,6 @@ +-- [SENSOR_PLACEMENT] +-- 王名豪 +-- 2025/04/18 +-- 删除sensor_placement这张表 + +drop table if exists sensor_placement; \ No newline at end of file diff --git a/script/sql/drop/43.burst_locate_result.sql b/script/sql/drop/43.burst_locate_result.sql new file mode 100644 index 0000000..0401af8 --- /dev/null +++ b/script/sql/drop/43.burst_locate_result.sql @@ -0,0 +1,6 @@ +-- [BURST_LOCATE_RESULT] +-- 王名豪 +-- 2025/04/19 +-- 删除burst_locate_result这张表 + +drop table if exists burst_locate_result; \ No newline at end of file