From c702c3b576fd57852d5fd26907dcaca5855124ac Mon Sep 17 00:00:00 2001 From: wuqun Date: Thu, 27 Oct 2022 13:58:43 +0800 Subject: [PATCH] =?UTF-8?q?(+)=E6=8E=A7=E5=88=B6=E5=8F=B0-=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E5=8A=A8=E6=80=81=E5=92=8C=E9=97=AE=E9=A2=98=E5=A4=84?= =?UTF-8?q?=E7=BD=AE=E6=95=88=E7=8E=87=E5=88=86=E6=9E=90=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E8=A1=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/0.0.6/schema/2.alarm_confirm_log.sql | 22 +++++++++++++++ script/0.0.6/schema/3.email_send_log.sql | 27 ++++++++++++++++++ script/0.0.6/schema/4.alarm_appear_record.sql | 23 +++++++++++++++ script/0.0.6/schema/5.latest_dynamic_list.sql | 28 +++++++++++++++++++ .../schema/6.alarm_handle_statistics.sql | 22 +++++++++++++++ 5 files changed, 122 insertions(+) create mode 100644 script/0.0.6/schema/2.alarm_confirm_log.sql create mode 100644 script/0.0.6/schema/3.email_send_log.sql create mode 100644 script/0.0.6/schema/4.alarm_appear_record.sql create mode 100644 script/0.0.6/schema/5.latest_dynamic_list.sql create mode 100644 script/0.0.6/schema/6.alarm_handle_statistics.sql diff --git a/script/0.0.6/schema/2.alarm_confirm_log.sql b/script/0.0.6/schema/2.alarm_confirm_log.sql new file mode 100644 index 0000000..6b32c4a --- /dev/null +++ b/script/0.0.6/schema/2.alarm_confirm_log.sql @@ -0,0 +1,22 @@ + + +create table alarm_confirm_log +( + id serial not null, + pep_user_id int null, + project_correlation_id int not null, + alarm_info json not null, + confirm_time timestamp not null, + confirm_content varchar not null +); + +comment on table alarm_confirm_log is '告警确认日志表'; + +create unique index alarm_confirm_log_id_uindex + on alarm_confirm_log (id); + +alter table alarm_confirm_log + add constraint alarm_confirm_log_pk + primary key (id); + + diff --git a/script/0.0.6/schema/3.email_send_log.sql b/script/0.0.6/schema/3.email_send_log.sql new file mode 100644 index 0000000..c02c700 --- /dev/null +++ b/script/0.0.6/schema/3.email_send_log.sql @@ -0,0 +1,27 @@ + + +create table if not exists email_send_log +( + id serial not null + constraint email_send_log_pk + primary key, + time timestamp not null, + push_config_id integer not null, + tactics varchar(32), + tactics_params jsonb, + project_correlation_id integer not null, + to_pep_user_ids integer[] not null +); + +comment on table email_send_log is 'EM推送日志'; + +alter table email_send_log owner to postgres; + +create unique index if not exists email_send_log_id_uindex + on email_send_log (id); + + + + + + diff --git a/script/0.0.6/schema/4.alarm_appear_record.sql b/script/0.0.6/schema/4.alarm_appear_record.sql new file mode 100644 index 0000000..d492466 --- /dev/null +++ b/script/0.0.6/schema/4.alarm_appear_record.sql @@ -0,0 +1,23 @@ + + +create table alarm_appear_record +( + id serial not null, + project_correlation_id int not null, + alarm_info json not null, + time timestamp, + type varchar null +); + +comment on table alarm_appear_record is '告警出现记录到日志'; + +create unique index alarm_appear_record_id_uindex + on alarm_appear_record (id); + +alter table alarm_appear_record + add constraint alarm_appear_record_pk + primary key (id); + + + + diff --git a/script/0.0.6/schema/5.latest_dynamic_list.sql b/script/0.0.6/schema/5.latest_dynamic_list.sql new file mode 100644 index 0000000..c73106f --- /dev/null +++ b/script/0.0.6/schema/5.latest_dynamic_list.sql @@ -0,0 +1,28 @@ + + +create table latest_dynamic_list +( + id serial not null, + time timestamp not null, + project_correlation_id int not null, + alarm_appear_id int, + email_send_id int, + alarm_confirm_id int, + type int +); + +comment on table latest_dynamic_list is '最新动态表'; +comment on column latest_dynamic_list.type is '1:发现,2:通知,3:处置,4:确认'; + +create unique index latest_dynamic_list_id_uindex + on latest_dynamic_list (id); + +alter table latest_dynamic_list + add constraint latest_dynamic_list_pk + primary key (id); + + + + + + diff --git a/script/0.0.6/schema/6.alarm_handle_statistics.sql b/script/0.0.6/schema/6.alarm_handle_statistics.sql new file mode 100644 index 0000000..54b5292 --- /dev/null +++ b/script/0.0.6/schema/6.alarm_handle_statistics.sql @@ -0,0 +1,22 @@ + + +create table alarm_handle_statistics +( + id serial not null, + time timestamp not null, + project_correlation_id int, + day1 float, + day3 float, + day7 float, + day15 float, + day30 float, + day30m float +); + +create unique index alarm_handle_statistics_id_uindex + on alarm_handle_statistics (id); + +alter table alarm_handle_statistics + add constraint alarm_handle_statistics_pk + primary key (id); +