From 25044e79215c18438d18a8db4a2988d2ce3e7364 Mon Sep 17 00:00:00 2001 From: CODE <1650192445@qq.com> Date: Tue, 29 Aug 2023 08:44:05 +0800 Subject: [PATCH] sql --- script/3.1/schema/1.create_p_group.sql | 17 +++++++++++++++++ script/3.1/schema/2.create_struc_off.sql | 22 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 script/3.1/schema/1.create_p_group.sql create mode 100644 script/3.1/schema/2.create_struc_off.sql diff --git a/script/3.1/schema/1.create_p_group.sql b/script/3.1/schema/1.create_p_group.sql new file mode 100644 index 0000000..9554274 --- /dev/null +++ b/script/3.1/schema/1.create_p_group.sql @@ -0,0 +1,17 @@ +create table if not exists project_group +( + id serial not null + constraint project_group_pk + primary key, + name varchar(256), + poms_project_ids integer[] not null, + poms_user_id integer not null + constraint project_group_user_id_fk + references "user" +); + +comment on column project_group.poms_project_ids is '运维项目id'; + +create unique index if not exists project_group_id_uindex + on project_group (id); + diff --git a/script/3.1/schema/2.create_struc_off.sql b/script/3.1/schema/2.create_struc_off.sql new file mode 100644 index 0000000..862e603 --- /dev/null +++ b/script/3.1/schema/2.create_struc_off.sql @@ -0,0 +1,22 @@ +create table if not exists t_structure_off +( + id serial not null + constraint t_structure_off_pk + primary key, + structure integer not null, + offline integer not null, + offtime varchar not null, + state integer not null +); + +comment on column t_structure_off.structure is '结构物id'; + +comment on column t_structure_off.offline is '离线时长(分钟)'; + +comment on column t_structure_off.offtime is '最后数据时间'; + +comment on column t_structure_off.state is '数据状态( 0:有效,1:无效)'; + +create unique index if not exists t_structure_off_id_uindex + on t_structure_off (id); +