Add sensor_placement and burse_locate_result

This commit is contained in:
DingZQ
2025-04-23 21:43:16 +08:00
parent de3ac89ab8
commit 291ac846c3
4 changed files with 39 additions and 0 deletions

View File

@@ -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[]
);

View File

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

View File

@@ -0,0 +1,6 @@
-- [SENSOR_PLACEMENT]
-- 王名豪
-- 2025/04/18
-- 删除sensor_placement这张表
drop table if exists sensor_placement;

View File

@@ -0,0 +1,6 @@
-- [BURST_LOCATE_RESULT]
-- 王名豪
-- 2025/04/19
-- 删除burst_locate_result这张表
drop table if exists burst_locate_result;