1.3.0.sql
2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
-- 增加指标分类字段, 默认0
ALTER TABLE public.evaluation_item_used
ADD indicator_type int4 NOT NULL DEFAULT 0;
COMMENT ON COLUMN public.evaluation_item_used.indicator_type IS '指标类型';
-- 增加项目表-任务负责人ID
ALTER TABLE public.evaluation_project
ADD principal_id text NULL;
COMMENT ON COLUMN public.evaluation_project.principal_id IS '任务负责人ID';
-- 增加评估Cache数据缓存表-任务里程碑JSON
ALTER TABLE public.staff_assess_cache
ADD assess_task_stages jsonb NULL;
COMMENT ON COLUMN public.staff_assess_cache.assess_task_stages IS '任务里程碑内容';
-- 添加表 task
CREATE TABLE public.task(
id bigserial NOT NULL,
created_at timestamptz NULL,
updated_at timestamptz NULL,
deleted_at timestamptz NULL,
"name" text NULL,
alias text NULL,
company_id int8 NULL,
leader jsonb NULL,
status int8 NULL,
"level" int8 NULL,
level_name text NULL,
related_user jsonb NULL,
run_at int8 NULL,
stop_at int8 NULL,
anomaly int8 NULL DEFAULT 0,
warn_flag int4 NULL,
current_stage jsonb NULL,
last_stage jsonb NULL,
CONSTRAINT task_pkey PRIMARY KEY (id)
);
-- 添加表 task_ignore
CREATE TABLE public.task_ignore(
id bigserial NOT NULL,
task_id int8 NULL,
user_id int8 NULL,
created_at timestamptz NULL
);
-- 添加表 task_level
CREATE TABLE public.task_level(
id bigserial NOT NULL,
level_name text NULL,
company_id int8 NULL,
CONSTRAINT task_level_pkey PRIMARY KEY (id)
);
-- 添加表 task_record
CREATE TABLE public.task_record(
id bigserial NOT NULL,
company_id int8 NULL,
staff_assess_id int8 NULL,
task_id int8 NULL,
task_category text NULL,
task_name text NULL,
task_alias text NULL,
task_leader jsonb NULL,
assist_level int8 NULL,
assist_content text NULL,
task_stages jsonb NULL,
task_stage_check jsonb NULL,
created_at timestamptz NULL,
updated_at timestamptz NULL,
deleted_at timestamptz NULL,
anomaly_state int8 NULL DEFAULT 0,
CONSTRAINT task_record_pkey PRIMARY KEY (id)
);
-- 添加表 task_stage
CREATE TABLE public.task_stage(
id bigserial NOT NULL,
task_id int8 NULL,
created_at timestamptz NULL,
updated_at timestamptz NULL,
deleted_at timestamptz NULL,
"name" text NULL,
sort_by int8 NULL,
plan_completed_at int8 NULL,
real_completed_at int8 NULL,
CONSTRAINT task_stage_pkey PRIMARY KEY (id)
);