Default-Value of Timestamp and Set/Enum (Maybe others) not enclosed

Hi,


I don’t know if you could name it a bug in generateChangeLog or in migrate but in combination on a table which has either Timestamp (MySQL) columns or Enum/Set (MySQL) columns, the default value in the corresponding statement (e.g. create table) does not enclose the strings, that are mapped by MySQL to integers correct.

Example:


CREATE TABLE test (

  ts TIMESTAMP DEFAULT ‘0000-00-00 00:00:00’ NOT NULL,

  val ENUM(‘a’,‘b’) DEFAULT ‘a’ NOT NULL

);


will be translated into:


       

           

               

           

           

               

           

     


which is interpreted by the migrate command as


CREATE TABLE test (

  ts TIMESTAMP DEFAULT 0000-00-00 00:00:00 NOT NULL,

  val ENUM(‘a’,‘b’) DEFAULT a NOT NULL

);


which s not valid because the strings are not enclosed. Might happen with other column-types as well.

Workaround here is to enclose the values by yourself into the defaultValue-Attricutes of the column-elements.

Keep in mind, that Enum-Generation does not work also yet, which is filed in another post, so please ignore this in this case.


Dominik

The issue with timestamps is fixed in the branch for the upcoming 3.0.8 release. The enum default is probably not fixed, though. I created https://liquibase.jira.com/browse/CORE-1647 for the enum issue, though.


Nathan