activiti.postgres.upgradestep.52.to.53.history.sql 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. execute java org.activiti.engine.impl.db.upgrade.DbUpgradeStep52To53InsertPropertyHistoryLevel
  2. -- removing not null constraint from ACT_HI_DETAIL.PROC_INST_ID_ and ACT_HI_DETAIL.EXECUTION_ID_
  3. create table ACT_HI_DETAIL_TMP (
  4. ID_ varchar(64) not null,
  5. TYPE_ varchar(255) not null,
  6. PROC_INST_ID_ varchar(64),
  7. EXECUTION_ID_ varchar(64),
  8. TASK_ID_ varchar(64),
  9. ACT_INST_ID_ varchar(64),
  10. NAME_ varchar(255),
  11. VAR_TYPE_ varchar(64),
  12. REV_ integer,
  13. TIME_ timestamp not null,
  14. BYTEARRAY_ID_ varchar(64),
  15. DOUBLE_ double precision,
  16. LONG_ bigint,
  17. TEXT_ varchar(255),
  18. TEXT2_ varchar(255),
  19. primary key (ID_)
  20. );
  21. insert into ACT_HI_DETAIL_TMP (ID_,TYPE_,PROC_INST_ID_,EXECUTION_ID_,TASK_ID_,ACT_INST_ID_,NAME_,VAR_TYPE_,REV_,TIME_,BYTEARRAY_ID_,DOUBLE_,LONG_,TEXT_,TEXT2_)
  22. select ID_,TYPE_,PROC_INST_ID_,EXECUTION_ID_,TASK_ID_,ACT_INST_ID_,NAME_,VAR_TYPE_,REV_,TIME_,BYTEARRAY_ID_,DOUBLE_,LONG_,TEXT_,TEXT2_ from ACT_HI_DETAIL;
  23. drop table ACT_HI_DETAIL;
  24. create table ACT_HI_DETAIL (
  25. ID_ varchar(64) not null,
  26. TYPE_ varchar(255) not null,
  27. PROC_INST_ID_ varchar(64),
  28. EXECUTION_ID_ varchar(64),
  29. TASK_ID_ varchar(64),
  30. ACT_INST_ID_ varchar(64),
  31. NAME_ varchar(255),
  32. VAR_TYPE_ varchar(64),
  33. REV_ integer,
  34. TIME_ timestamp not null,
  35. BYTEARRAY_ID_ varchar(64),
  36. DOUBLE_ double precision,
  37. LONG_ bigint,
  38. TEXT_ varchar(255),
  39. TEXT2_ varchar(255),
  40. primary key (ID_)
  41. );
  42. create index ACT_IDX_HI_DETAIL_PROC_INST on ACT_HI_DETAIL(PROC_INST_ID_);
  43. create index ACT_IDX_HI_DETAIL_ACT_INST on ACT_HI_DETAIL(ACT_INST_ID_);
  44. create index ACT_IDX_HI_DETAIL_TIME on ACT_HI_DETAIL(TIME_);
  45. create index ACT_IDX_HI_DETAIL_NAME on ACT_HI_DETAIL(NAME_);
  46. insert into ACT_HI_DETAIL (ID_,TYPE_,PROC_INST_ID_,EXECUTION_ID_,TASK_ID_,ACT_INST_ID_,NAME_,VAR_TYPE_,REV_,TIME_,BYTEARRAY_ID_,DOUBLE_,LONG_,TEXT_,TEXT2_)
  47. select ID_,TYPE_,PROC_INST_ID_,EXECUTION_ID_,TASK_ID_,ACT_INST_ID_,NAME_,VAR_TYPE_,REV_,TIME_,BYTEARRAY_ID_,DOUBLE_,LONG_,TEXT_,TEXT2_ from ACT_HI_DETAIL_TMP;
  48. drop table ACT_HI_DETAIL_TMP;
  49. -- Add column PRIORITY_ to ACT_HI_TASKINST and set to default priority (ACT-484)
  50. alter table ACT_HI_TASKINST add column PRIORITY_ integer;
  51. update ACT_HI_TASKINST set PRIORITY_ = 50;