Class UpgradeServices


  • public class UpgradeServices
    extends java.lang.Object
    Entity Data Upgrade Services
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String module  
      static java.lang.String resource  
    • Constructor Summary

      Constructors 
      Constructor Description
      UpgradeServices()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.Object> generateMySqlFileWithAlterTableForTimestamps​(DispatchContext dctx, java.util.Map<java.lang.String,​java.lang.Object> context)
      Generate sql file for data migration from mySql.5 and earlier version to mySql.6 to later version mySql added support in 5.6 to support microseconds for datetime field.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • module

        public static final java.lang.String module
    • Constructor Detail

      • UpgradeServices

        public UpgradeServices()
    • Method Detail

      • generateMySqlFileWithAlterTableForTimestamps

        public static java.util.Map<java.lang.String,​java.lang.Object> generateMySqlFileWithAlterTableForTimestamps​(DispatchContext dctx,
                                                                                                                          java.util.Map<java.lang.String,​java.lang.Object> context)
        Generate sql file for data migration from mySql.5 and earlier version to mySql.6 to later version mySql added support in 5.6 to support microseconds for datetime field. https://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html
        • Service will take [groupName] as in param,
        • iterate all the entity and check for datetime and time field
        • it will generate alter table sql statement to update the field data type
        • datetime will be altered with DATETIME(3)
        • time will be altered with TIME(3)
        • sql fiel will be created at following location
        • ${ofbiz.home}/runtime/tempfiles/[groupName].sql
        Parameters:
        dctx -
        context -
        Returns:
        Map with the success result of the service,