activiti.mysql.upgradestep.515.to.5151.history.sql 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Following statements are a duplication of the 5.15 updates. See explanation in the engine update script why they need to be repeated.
  2. #
  3. # ACT-1867: MySQL DATETIME and TIMESTAMP precision
  4. # The way this is done, is by creating a new column, pumping over all data
  5. # and then removing the old column.
  6. #
  7. # START_TIME_ in ACT_HI_PROCINST
  8. ALTER TABLE ACT_HI_PROCINST ADD START_TIME_TEMP_ datetime(3) not null;
  9. UPDATE ACT_HI_PROCINST SET START_TIME_TEMP_ = START_TIME_;
  10. ALTER TABLE ACT_HI_PROCINST DROP COLUMN START_TIME_;
  11. ALTER TABLE ACT_HI_PROCINST CHANGE START_TIME_TEMP_ START_TIME_ datetime(3) not null;
  12. # END_TIME_ in ACT_HI_PROCINST
  13. ALTER TABLE ACT_HI_PROCINST ADD END_TIME_TEMP_ datetime(3);
  14. UPDATE ACT_HI_PROCINST SET END_TIME_TEMP_ = END_TIME_;
  15. ALTER TABLE ACT_HI_PROCINST DROP COLUMN END_TIME_;
  16. ALTER TABLE ACT_HI_PROCINST CHANGE END_TIME_TEMP_ END_TIME_ datetime(3);
  17. # START_TIME_ in ACT_HI_ACTINST
  18. ALTER TABLE ACT_HI_ACTINST ADD START_TIME_TEMP_ datetime(3) not null;
  19. UPDATE ACT_HI_ACTINST SET START_TIME_TEMP_ = START_TIME_;
  20. ALTER TABLE ACT_HI_ACTINST DROP COLUMN START_TIME_;
  21. ALTER TABLE ACT_HI_ACTINST CHANGE START_TIME_TEMP_ START_TIME_ datetime(3) not null;
  22. # END_TIME_ in ACT_HI_ACTINST
  23. ALTER TABLE ACT_HI_ACTINST ADD END_TIME_TEMP_ datetime(3);
  24. UPDATE ACT_HI_ACTINST SET END_TIME_TEMP_ = END_TIME_;
  25. ALTER TABLE ACT_HI_ACTINST DROP COLUMN END_TIME_;
  26. ALTER TABLE ACT_HI_ACTINST CHANGE END_TIME_TEMP_ END_TIME_ datetime(3);
  27. # START_TIME_ in ACT_HI_TASKINST
  28. ALTER TABLE ACT_HI_TASKINST ADD START_TIME_TEMP_ datetime(3) not null;
  29. UPDATE ACT_HI_TASKINST SET START_TIME_TEMP_ = START_TIME_;
  30. ALTER TABLE ACT_HI_TASKINST DROP COLUMN START_TIME_;
  31. ALTER TABLE ACT_HI_TASKINST CHANGE START_TIME_TEMP_ START_TIME_ datetime(3) not null;
  32. # CLAIM_TIME_ in ACT_HI_TASKINST
  33. ALTER TABLE ACT_HI_TASKINST ADD CLAIM_TIME_TEMP_ datetime(3);
  34. UPDATE ACT_HI_TASKINST SET CLAIM_TIME_TEMP_ = CLAIM_TIME_;
  35. ALTER TABLE ACT_HI_TASKINST DROP COLUMN CLAIM_TIME_;
  36. ALTER TABLE ACT_HI_TASKINST CHANGE CLAIM_TIME_TEMP_ CLAIM_TIME_ datetime(3);
  37. # END_TIME_ in ACT_HI_TASKINST
  38. ALTER TABLE ACT_HI_TASKINST ADD END_TIME_TEMP_ datetime(3);
  39. UPDATE ACT_HI_TASKINST SET END_TIME_TEMP_ = END_TIME_;
  40. ALTER TABLE ACT_HI_TASKINST DROP COLUMN END_TIME_;
  41. ALTER TABLE ACT_HI_TASKINST CHANGE END_TIME_TEMP_ END_TIME_ datetime(3);
  42. # DUE_DATE_ in ACT_HI_TASKINST
  43. ALTER TABLE ACT_HI_TASKINST ADD DUE_DATE_TEMP_ datetime(3);
  44. UPDATE ACT_HI_TASKINST SET DUE_DATE_TEMP_ = DUE_DATE_;
  45. ALTER TABLE ACT_HI_TASKINST DROP COLUMN DUE_DATE_;
  46. ALTER TABLE ACT_HI_TASKINST CHANGE DUE_DATE_TEMP_ DUE_DATE_ datetime(3);
  47. # TIME_ in ACT_HI_DETAIL
  48. ALTER TABLE ACT_HI_DETAIL ADD TIME_TEMP_ datetime(3) not null;
  49. UPDATE ACT_HI_DETAIL SET TIME_TEMP_ = TIME_;
  50. ALTER TABLE ACT_HI_DETAIL DROP COLUMN TIME_;
  51. ALTER TABLE ACT_HI_DETAIL CHANGE TIME_TEMP_ TIME_ datetime(3) not null;
  52. # TIME_ in ACT_HI_COMMENT
  53. ALTER TABLE ACT_HI_COMMENT ADD TIME_TEMP_ datetime(3) not null;
  54. UPDATE ACT_HI_COMMENT SET TIME_TEMP_ = TIME_;
  55. ALTER TABLE ACT_HI_COMMENT DROP COLUMN TIME_;
  56. ALTER TABLE ACT_HI_COMMENT CHANGE TIME_TEMP_ TIME_ datetime(3) not null;