diff --git a/nflow-engine/src/main/resources/scripts/db/oracle.create.ddl.sql b/nflow-engine/src/main/resources/scripts/db/oracle.create.ddl.sql index ce34e6b43..a65e21a15 100644 --- a/nflow-engine/src/main/resources/scripts/db/oracle.create.ddl.sql +++ b/nflow-engine/src/main/resources/scripts/db/oracle.create.ddl.sql @@ -4,7 +4,7 @@ create table nflow_workflow ( id int not null primary key, status varchar(32) not null, type varchar(64) not null, - priority smallint not null default 0, + priority smallint default 0 not null, parent_workflow_id int default null, parent_action_id int default null, business_key varchar(64), diff --git a/nflow-engine/src/main/resources/scripts/db/update-7.2.5-x/oracle.update.ddl.sql b/nflow-engine/src/main/resources/scripts/db/update-7.2.5-x/oracle.update.ddl.sql index 82f5cb6d6..34d7703b6 100644 --- a/nflow-engine/src/main/resources/scripts/db/update-7.2.5-x/oracle.update.ddl.sql +++ b/nflow-engine/src/main/resources/scripts/db/update-7.2.5-x/oracle.update.ddl.sql @@ -4,10 +4,19 @@ alter sequence nflow_executor_id_seq nocache alter sequence nflow_workflow_id_seq nocache / -drop sequence nflow_workflow_action_id_seq -/ - -create sequence nflow_workflow_action_id_seq start with (select max(id) + 1000 from nflow_workflow_action) nocache +declare + id_with_slack number; +begin + select max(id) + 1000 into id_with_slack from nflow_workflow_action; + if id_with_slack > 0 then + begin + execute immediate 'drop sequence nflow_workflow_action_id_seq'; + exception when others then + null; + end; + execute immediate 'create sequence nflow_workflow_action_id_seq start with ' || id_with_slack || ' nocache'; + end if; +end; / create or replace trigger nflow_workflow_action_insert