activiti.mysql.upgradestep.514.to.515.history.sql 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. alter table ACT_HI_TASKINST
  2. add CATEGORY_ varchar(255);
  3. alter table ACT_HI_PROCINST drop index ACT_UNIQ_HI_BUS_KEY;
  4. #
  5. # ACT-1867: MySQL DATETIME and TIMESTAMP precision
  6. # The way this is done, is by creating a new column, pumping over all data
  7. # and then removing the old column.
  8. #
  9. # START_TIME_ in ACT_HI_PROCINST
  10. ALTER TABLE ACT_HI_PROCINST ADD START_TIME_TEMP_ datetime(3) not null;
  11. UPDATE ACT_HI_PROCINST SET START_TIME_TEMP_ = START_TIME_;
  12. ALTER TABLE ACT_HI_PROCINST DROP COLUMN START_TIME_;
  13. ALTER TABLE ACT_HI_PROCINST CHANGE START_TIME_TEMP_ START_TIME_ datetime(3) not null;
  14. # END_TIME_ in ACT_HI_PROCINST
  15. ALTER TABLE ACT_HI_PROCINST ADD END_TIME_TEMP_ datetime(3);
  16. UPDATE ACT_HI_PROCINST SET END_TIME_TEMP_ = END_TIME_;
  17. ALTER TABLE ACT_HI_PROCINST DROP COLUMN END_TIME_;
  18. ALTER TABLE ACT_HI_PROCINST CHANGE END_TIME_TEMP_ END_TIME_ datetime(3);
  19. # START_TIME_ in ACT_HI_ACTINST
  20. ALTER TABLE ACT_HI_ACTINST ADD START_TIME_TEMP_ datetime(3) not null;
  21. UPDATE ACT_HI_ACTINST SET START_TIME_TEMP_ = START_TIME_;
  22. ALTER TABLE ACT_HI_ACTINST DROP COLUMN START_TIME_;
  23. ALTER TABLE ACT_HI_ACTINST CHANGE START_TIME_TEMP_ START_TIME_ datetime(3) not null;
  24. # END_TIME_ in ACT_HI_ACTINST
  25. ALTER TABLE ACT_HI_ACTINST ADD END_TIME_TEMP_ datetime(3);
  26. UPDATE ACT_HI_ACTINST SET END_TIME_TEMP_ = END_TIME_;
  27. ALTER TABLE ACT_HI_ACTINST DROP COLUMN END_TIME_;
  28. ALTER TABLE ACT_HI_ACTINST CHANGE END_TIME_TEMP_ END_TIME_ datetime(3);
  29. # START_TIME_ in ACT_HI_TASKINST
  30. ALTER TABLE ACT_HI_TASKINST ADD START_TIME_TEMP_ datetime(3) not null;
  31. UPDATE ACT_HI_TASKINST SET START_TIME_TEMP_ = START_TIME_;
  32. ALTER TABLE ACT_HI_TASKINST DROP COLUMN START_TIME_;
  33. ALTER TABLE ACT_HI_TASKINST CHANGE START_TIME_TEMP_ START_TIME_ datetime(3) not null;
  34. # CLAIM_TIME_ in ACT_HI_TASKINST
  35. ALTER TABLE ACT_HI_TASKINST ADD CLAIM_TIME_TEMP_ datetime(3);
  36. UPDATE ACT_HI_TASKINST SET CLAIM_TIME_TEMP_ = CLAIM_TIME_;
  37. ALTER TABLE ACT_HI_TASKINST DROP COLUMN CLAIM_TIME_;
  38. ALTER TABLE ACT_HI_TASKINST CHANGE CLAIM_TIME_TEMP_ CLAIM_TIME_ datetime(3);
  39. # END_TIME_ in ACT_HI_TASKINST
  40. ALTER TABLE ACT_HI_TASKINST ADD END_TIME_TEMP_ datetime(3);
  41. UPDATE ACT_HI_TASKINST SET END_TIME_TEMP_ = END_TIME_;
  42. ALTER TABLE ACT_HI_TASKINST DROP COLUMN END_TIME_;
  43. ALTER TABLE ACT_HI_TASKINST CHANGE END_TIME_TEMP_ END_TIME_ datetime(3);
  44. # DUE_DATE_ in ACT_HI_TASKINST
  45. ALTER TABLE ACT_HI_TASKINST ADD DUE_DATE_TEMP_ datetime(3);
  46. UPDATE ACT_HI_TASKINST SET DUE_DATE_TEMP_ = DUE_DATE_;
  47. ALTER TABLE ACT_HI_TASKINST DROP COLUMN DUE_DATE_;
  48. ALTER TABLE ACT_HI_TASKINST CHANGE DUE_DATE_TEMP_ DUE_DATE_ datetime(3);
  49. # TIME_ in ACT_HI_DETAIL
  50. ALTER TABLE ACT_HI_DETAIL ADD TIME_TEMP_ datetime(3) not null;
  51. UPDATE ACT_HI_DETAIL SET TIME_TEMP_ = TIME_;
  52. ALTER TABLE ACT_HI_DETAIL DROP COLUMN TIME_;
  53. ALTER TABLE ACT_HI_DETAIL CHANGE TIME_TEMP_ TIME_ datetime(3) not null;
  54. # TIME_ in ACT_HI_COMMENT
  55. ALTER TABLE ACT_HI_COMMENT ADD TIME_TEMP_ datetime(3) not null;
  56. UPDATE ACT_HI_COMMENT SET TIME_TEMP_ = TIME_;
  57. ALTER TABLE ACT_HI_COMMENT DROP COLUMN TIME_;
  58. ALTER TABLE ACT_HI_COMMENT CHANGE TIME_TEMP_ TIME_ datetime(3) not null;
  59. alter table ACT_HI_VARINST
  60. add CREATE_TIME_ datetime(3);
  61. alter table ACT_HI_VARINST
  62. add LAST_UPDATED_TIME_ datetime(3);
  63. alter table ACT_HI_PROCINST
  64. add TENANT_ID_ varchar(255) default '';
  65. alter table ACT_HI_ACTINST
  66. add TENANT_ID_ varchar(255) default '';
  67. alter table ACT_HI_TASKINST
  68. add TENANT_ID_ varchar(255) default '';
  69. alter table ACT_HI_ACTINST
  70. MODIFY ASSIGNEE_ varchar(255);