convert_after_postgres.sql
1.21 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
do $$
begin
if exists(select *
from information_schema.columns
where table_name = 'sungero_docflow_approvalrule' and column_name = 'needrestrinar')
then
-- Выключить Ограничить права инициатора на документ и приложения.
update
sungero_docflow_approvalrule
set
needrestrinar = false
where
needrestrinar is null;
end if;
if exists(select *
from information_schema.columns
where table_name = 'sungero_docflow_approvalstage' and column_name = 'needrestrperar')
then
-- Выключить Ограничить права исполнителя после выполнения задания.
update
sungero_docflow_approvalstage
set
needrestrperar = false
where
needrestrperar is null;
end if;
if exists(select *
from information_schema.columns
where table_name = 'sungero_docflow_approvalstage' and column_name = 'rightstype')
then
-- Установить тип прав по умолчанию.
update
sungero_docflow_approvalstage
set
rightstype = case when stagetype = 'Print' then 'Read' else 'Edit' end
where
rightstype is null;
end if;
end $$;