MySql: DateTime size doesn't get picked by createTable / addColumn changesets

Running the following changeset using liquibase-3.2.2 (on mySql 5.6):

  1. < createTable   tableName = "myTable" >   
  2.     < column   name = "myId"   type = "BIGINT(20) UNSIGNED" >   
  3.         < constraints   nullable = "false" />   
  4.     </ column >   
  5.      < column   name = "my_time"   type = "datetime(3)" >   
  6.         < constraints   nullable = "false" />   
  7.     </ column >   
  8. </ createTable>

Will create the “my_time” column with “datetime” type instead of “datetime(3)” type, which means - it won’t store milliseconds.

As a workaround, I create the table using changeset.

(also, FYI, I couldn’t find a way to open a JIRA ticket in https://liquibase.jira.com/ - it didn’t allow me to create a user using any of my email addresses saying my domain is not allowed)

(also, FYI, I couldn't find a way to open a JIRA ticket in  https://liquibase.jira.com/  - it didn't allow me to create a user using any of my email addresses saying my domain is not allowed)

 


Same here, started a thread on that.

This is fixed for the upcoming 3.3.0 release. 

Nathan