diff --git a/script/0.27/schema/1.create_equipment_maintenance_record_execute_user.sql b/script/0.27/schema/1.create_equipment_maintenance_record_execute_user.sql new file mode 100644 index 0000000..4ac2617 --- /dev/null +++ b/script/0.27/schema/1.create_equipment_maintenance_record_execute_user.sql @@ -0,0 +1,9 @@ +create table equipment_maintenance_record_execute_user +( + id serial + primary key, + equipment_maintenance_record_id integer + constraint equipment_maintenance_record_equipment_maintenance_record_fkey1 + references equipment_maintenance_record, + pep_user_id integer +); diff --git a/script/0.27/schema/2.create_equipment_maintenance_record_project.sql b/script/0.27/schema/2.create_equipment_maintenance_record_project.sql new file mode 100644 index 0000000..67d593f --- /dev/null +++ b/script/0.27/schema/2.create_equipment_maintenance_record_project.sql @@ -0,0 +1,9 @@ +create table equipment_maintenance_record_project +( + id serial + primary key, + equipment_maintenance_record_id integer + constraint equipment_maintenance_record__equipment_maintenance_record_fkey + references equipment_maintenance_record, + project_id integer +); \ No newline at end of file diff --git a/script/0.27/schema/3.create_equipment_maintenance_record.sql b/script/0.27/schema/3.create_equipment_maintenance_record.sql new file mode 100644 index 0000000..e7f1ffa --- /dev/null +++ b/script/0.27/schema/3.create_equipment_maintenance_record.sql @@ -0,0 +1,26 @@ +drop table if exists equipment_maintenance_record; +create table equipment_maintenance_record +( + id serial + primary key, + equipment_type varchar(32), + equipment_category varchar(32), + maintenance_reason varchar(1024), + solution varchar(1024), + report_time timestamp with time zone, + completed_time timestamp with time zone, + status varchar(32) +); +comment on column public.equipment_maintenance_record.equipment_type is '设备型号'; + +comment on column public.equipment_maintenance_record.equipment_category is '设备类型'; + +comment on column public.equipment_maintenance_record.maintenance_reason is '维修原因'; + +comment on column public.equipment_maintenance_record.solution is '解决方案'; + +comment on column public.equipment_maintenance_record.report_time is '上报时间'; + +comment on column public.equipment_maintenance_record.completed_time is '维修完成时间'; + +comment on column public.equipment_maintenance_record.status is '状态'; \ No newline at end of file diff --git a/script/0.27/schema/4.create_server_maintenance_record_repairman.sql b/script/0.27/schema/4.create_server_maintenance_record_repairman.sql new file mode 100644 index 0000000..2ac702e --- /dev/null +++ b/script/0.27/schema/4.create_server_maintenance_record_repairman.sql @@ -0,0 +1,5 @@ +create table server_maintenance_record_repairman( + id serial primary key, + server_maintenance_record_id integer references server_maintenance_record(id), + pep_user_id integer +) \ No newline at end of file diff --git a/script/0.27/schema/5.create_server_maintenance_record.sql b/script/0.27/schema/5.create_server_maintenance_record.sql new file mode 100644 index 0000000..3adf6bd --- /dev/null +++ b/script/0.27/schema/5.create_server_maintenance_record.sql @@ -0,0 +1,16 @@ +create table server_maintenance_record( + id serial primary key, + sketch varchar(512), + reason varchar(512), + remark varchar(1024), + maintenance_start_time timestamp with time zone, + maintenance_finish_time timestamp with time zone, + state varchar(32) + ); +comment on column public.server_maintenance_record.sketch is '简述'; +comment on column public.server_maintenance_record.reason is '维修原因'; +comment on column public.server_maintenance_record.remark is '备注'; +comment on column public.server_maintenance_record.maintenance_start_time is '维护开始时间'; +comment on column public.server_maintenance_record.maintenance_finish_time is '维护结束时间'; +comment on column public.server_maintenance_record.state is '维护结束时间'; +comment on column public.server_maintenance_record.state is '完成状态 wait 待维修 / underway 维修中 / completed 维修完成 '; diff --git a/script/0.28/schema/2.create_sysyem_problem.sql b/script/0.28/schema/2.create_sysyem_problem.sql new file mode 100644 index 0000000..af601fd --- /dev/null +++ b/script/0.28/schema/2.create_sysyem_problem.sql @@ -0,0 +1,15 @@ +create table public.system_problem( + id serial primary key, + type varchar(20) +); +comment on column public.system_problem.type is '问题类型:数据库异常、es异常、kafka异常、服务器异常、应用异常、其他'; + +insert into system_problem ( type)values ('es异常'); +insert into system_problem (type)values ('数据库异常'); +insert into system_problem (type)values ('应用异常'); +insert into system_problem (type)values ('kafka异常'); +insert into system_problem (type)values ('服务器异常'); +insert into system_problem (type)values ('DAC进程异常'); +insert into system_problem (type)values ('K8S集群异常'); +insert into system_problem (type)values ('redis服务异常'); +insert into system_problem (type)values ('其他');