Skip to content

Commit

Permalink
add statements to disable/remove triggers before updates and enable/c…
Browse files Browse the repository at this point in the history
…reate them after updates
  • Loading branch information
Edvard Fonsell committed Nov 25, 2019
1 parent 0912067 commit 2dfd8de
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ alter table nflow_workflow add priority smallint not null default 0;
-- For large nflow_workflow row count:
--
-- alter table nflow_workflow add priority smallint null;
-- drop trigger if exists nflow_workflow_update_modified;
--
-- followed by either:
--
Expand All @@ -15,6 +16,11 @@ alter table nflow_workflow add priority smallint not null default 0;
-- and finally:
--
-- alter table nflow_workflow alter column priority smallint not null default 0;
-- create trigger nflow_workflow_update_modified
-- before update on nflow_workflow
-- referencing new as n
-- for each row
-- set modified = current timestamp;

alter table nflow_archive_workflow add priority smallint null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ alter table nflow_workflow add priority smallint not null default 0
--
-- alter table nflow_workflow add priority smallint null
-- /
-- alter trigger nflow_workflow_update disable
-- /
--
-- followed by either:
--
Expand All @@ -20,6 +22,8 @@ alter table nflow_workflow add priority smallint not null default 0
--
-- alter table nflow_workflow alter column priority smallint not null default 0
-- /
-- alter trigger nflow_workflow_update enable
-- /


alter table nflow_archive_workflow add priority smallint null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ alter table nflow_workflow add priority smallint not null default 0;
-- For large nflow_workflow row count:
--
-- alter table nflow_workflow add priority smallint null;
-- alter table nflow_workflow disable trigger update_nflow_modified;
--
-- followed by either:
--
Expand All @@ -15,6 +16,7 @@ alter table nflow_workflow add priority smallint not null default 0;
-- and finally:
--
-- alter table nflow_workflow alter column priority smallint not null default 0;
-- alter table nflow_workflow enable trigger update_nflow_modified;

alter table nflow_archive_workflow add priority smallint null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ alter table nflow_workflow add priority smallint not null default 0;
-- For large nflow_workflow row count:
--
-- alter table nflow_workflow add priority smallint null;
-- disable trigger nflow_workflow_modified_trigger on nflow_workflow;
--
-- followed by either:
--
Expand All @@ -15,6 +16,7 @@ alter table nflow_workflow add priority smallint not null default 0;
-- and finally:
--
-- alter table nflow_workflow alter column priority smallint not null default 0;
-- enable trigger nflow_workflow_modified_trigger on nflow_workflow;

alter table nflow_archive_workflow add priority smallint null;

Expand Down

0 comments on commit 2dfd8de

Please sign in to comment.