作者 郑周

1. 1.2.4脚本命令

正在显示 1 个修改的文件 包含 13 行增加9 行删除
1 -- 权限表建新列 1 -- 权限表建新列
2 -ALTER TABLE public."permission" ADD opt_confirm_perf int8 NULL DEFAULT 1;  
3 -COMMENT ON COLUMN public."permission".opt_confirm_perf IS '是否需要员工确认绩效'; 2 +ALTER TABLE public."permission"
  3 + ADD opt_confirm_perf int8 NULL DEFAULT 1;
  4 +COMMENT
  5 +ON COLUMN public."permission".opt_confirm_perf IS '是否需要员工确认绩效';
4 6
5 -ALTER TABLE public."permission" ADD cycle_deadline jsonb NULL;  
6 -COMMENT ON COLUMN public."permission".cycle_deadline IS '周期评估各业务截止时间'; 7 +ALTER TABLE public."permission"
  8 + ADD cycle_deadline jsonb NULL;
  9 +COMMENT
  10 +ON COLUMN public."permission".cycle_deadline IS '周期评估各业务截止时间';
7 11
8 12
9 -- 公司添加超级管理员(不存在时插入新数据)(注.公司ID->416) 13 -- 公司添加超级管理员(不存在时插入新数据)(注.公司ID->416)
@@ -42,9 +46,8 @@ with temp_role as ( @@ -42,9 +46,8 @@ with temp_role as (
42 from 46 from
43 public."role" 47 public."role"
44 where 48 where
45 - "role".company_id = 416  
46 - and "role"."type" = 2  
47 -) 49 + "role".company_id = 416
  50 + and "role"."type" = 2)
48 insert 51 insert
49 into 52 into
50 public."role_user" 53 public."role_user"
@@ -64,12 +67,13 @@ select @@ -64,12 +67,13 @@ select
64 from 67 from
65 temp_role 68 temp_role
66 where 69 where
67 - not exists ( 70 + not exists(
68 select 71 select
69 1 72 1
70 from 73 from
71 public."role_user" 74 public."role_user"
72 where 75 where
73 - "role_user".company_id = 416 76 + "role_user".company_id = 416
74 and "role_user".user_id = 3337322891762688 77 and "role_user".user_id = 3337322891762688
75 and "role_user".role_id = temp_role."id"); 78 and "role_user".role_id = temp_role."id");
  79 +--