activiti.mysql.upgradestep.514.to.515.engine.sql 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. alter table ACT_RU_TASK
  2. add CATEGORY_ varchar(255);
  3. alter table ACT_RU_EXECUTION drop foreign key ACT_FK_EXE_PROCDEF;
  4. alter table ACT_RU_EXECUTION drop index ACT_UNIQ_RU_BUS_KEY;
  5. alter table ACT_RU_EXECUTION
  6. add constraint ACT_FK_EXE_PROCDEF
  7. foreign key (PROC_DEF_ID_)
  8. references ACT_RE_PROCDEF (ID_);
  9. #
  10. # ACT-1867: MySQL DATETIME and TIMESTAMP precision
  11. # The way this is done, is by creating a new column, pumping over all data
  12. # and then removing the old column.
  13. #
  14. # DEPLOY_TIME_ in ACT_RE_DEPLOYMENT
  15. ALTER TABLE ACT_RE_DEPLOYMENT ADD DEPLOY_TIME_TEMP_ timestamp(3);
  16. UPDATE ACT_RE_DEPLOYMENT SET DEPLOY_TIME_TEMP_ = DEPLOY_TIME_;
  17. ALTER TABLE ACT_RE_DEPLOYMENT DROP COLUMN DEPLOY_TIME_;
  18. ALTER TABLE ACT_RE_DEPLOYMENT CHANGE DEPLOY_TIME_TEMP_ DEPLOY_TIME_ timestamp(3);
  19. # CREATE_TIME_ in ACT_RE_MODEL
  20. ALTER TABLE ACT_RE_MODEL ADD CREATE_TIME_TEMP_ timestamp(3) null;
  21. UPDATE ACT_RE_MODEL SET CREATE_TIME_TEMP_ = CREATE_TIME_;
  22. ALTER TABLE ACT_RE_MODEL DROP COLUMN CREATE_TIME_;
  23. ALTER TABLE ACT_RE_MODEL CHANGE CREATE_TIME_TEMP_ CREATE_TIME_ timestamp(3) null;
  24. # LAST_UPDATE_TIME_ in ACT_RE_MODEL
  25. ALTER TABLE ACT_RE_MODEL ADD LAST_UPDATE_TIME_TEMP_ timestamp(3) null;
  26. UPDATE ACT_RE_MODEL SET LAST_UPDATE_TIME_TEMP_ = LAST_UPDATE_TIME_;
  27. ALTER TABLE ACT_RE_MODEL DROP COLUMN LAST_UPDATE_TIME_;
  28. ALTER TABLE ACT_RE_MODEL CHANGE LAST_UPDATE_TIME_TEMP_ LAST_UPDATE_TIME_ timestamp(3) null;
  29. # LOCK_EXP_TIME_ in ACT_RU_JOB
  30. ALTER TABLE ACT_RU_JOB ADD LOCK_EXP_TIME_TEMP_ timestamp(3) null;
  31. UPDATE ACT_RU_JOB SET LOCK_EXP_TIME_TEMP_ = LOCK_EXP_TIME_;
  32. ALTER TABLE ACT_RU_JOB DROP COLUMN LOCK_EXP_TIME_;
  33. ALTER TABLE ACT_RU_JOB CHANGE LOCK_EXP_TIME_TEMP_ LOCK_EXP_TIME_ timestamp(3) null;
  34. # DUEDATE_ in ACT_RU_JOB
  35. ALTER TABLE ACT_RU_JOB ADD DUEDATE_TEMP_ timestamp(3) null;
  36. UPDATE ACT_RU_JOB SET DUEDATE_TEMP_ = DUEDATE_;
  37. ALTER TABLE ACT_RU_JOB DROP COLUMN DUEDATE_;
  38. ALTER TABLE ACT_RU_JOB CHANGE DUEDATE_TEMP_ DUEDATE_ timestamp(3) null;
  39. # CREATE_TIME_ in ACT_RU_TASK
  40. ALTER TABLE ACT_RU_TASK ADD CREATE_TIME_TEMP_ timestamp(3);
  41. UPDATE ACT_RU_TASK SET CREATE_TIME_TEMP_ = CREATE_TIME_;
  42. ALTER TABLE ACT_RU_TASK DROP COLUMN CREATE_TIME_;
  43. ALTER TABLE ACT_RU_TASK CHANGE CREATE_TIME_TEMP_ CREATE_TIME_ timestamp(3);
  44. # DUE_DATE_ in ACT_RU_TASK
  45. ALTER TABLE ACT_RU_TASK ADD DUE_DATE_TEMP_ datetime(3);
  46. UPDATE ACT_RU_TASK SET DUE_DATE_TEMP_ = DUE_DATE_;
  47. ALTER TABLE ACT_RU_TASK DROP COLUMN DUE_DATE_;
  48. ALTER TABLE ACT_RU_TASK CHANGE DUE_DATE_TEMP_ DUE_DATE_ datetime(3);
  49. # CREATED_ in ACT_RU_EVENT_SUBSCR
  50. ALTER TABLE ACT_RU_EVENT_SUBSCR ADD CREATED_TEMP_ timestamp(3) not null;
  51. UPDATE ACT_RU_EVENT_SUBSCR SET CREATED_TEMP_ = CREATED_;
  52. ALTER TABLE ACT_RU_EVENT_SUBSCR DROP COLUMN CREATED_;
  53. ALTER TABLE ACT_RU_EVENT_SUBSCR CHANGE CREATED_TEMP_ CREATED_ timestamp(3) not null DEFAULT CURRENT_TIMESTAMP(3);
  54. alter table ACT_RE_DEPLOYMENT
  55. add TENANT_ID_ varchar(255) default '';
  56. alter table ACT_RE_PROCDEF
  57. add TENANT_ID_ varchar(255) default '';
  58. alter table ACT_RU_EXECUTION
  59. add TENANT_ID_ varchar(255) default '';
  60. alter table ACT_RU_TASK
  61. add TENANT_ID_ varchar(255) default '';
  62. alter table ACT_RU_JOB
  63. add TENANT_ID_ varchar(255) default '';
  64. alter table ACT_RE_MODEL
  65. add TENANT_ID_ varchar(255) default '';
  66. alter table ACT_RU_EVENT_SUBSCR
  67. add TENANT_ID_ varchar(255) default '';
  68. alter table ACT_RU_EVENT_SUBSCR
  69. add PROC_DEF_ID_ varchar(64);
  70. alter table ACT_RE_PROCDEF
  71. drop index ACT_UNIQ_PROCDEF;
  72. alter table ACT_RE_PROCDEF
  73. add constraint ACT_UNIQ_PROCDEF
  74. unique (KEY_,VERSION_, TENANT_ID_);
  75. update ACT_GE_PROPERTY set VALUE_ = '5.15' where NAME_ = 'schema.version';