TO REPRODUCE:
Create a database table in MySQL that contains an enum column (or use
to create)
Use generateChangeLog to capture the table
Delete the table
Run 'update' with the change log generated in Step 2
RESULTS:
The 'update' fails. Error details can be found in
If you look at
there are 2 problems that keep the changeset from running successfully:
The type attribute contains size information instead of enum values
BAD: type="ENUM(5)"
GOOD: type="ENUM('one','two','three')"
The defaultValue attribute is not appropriately quoted
BAD: defaultValue="one"
GOOD: defaultValue="'one'"
If you manually update the xml to correct these 2 issues (example:
) it can be used with Liquibase to create the table.
NOTE: Even with the manually updated file, the enum isn't created appropriately. Only the first two possible entries specified by type="ENUM('one','two','three')" are included in the enum in the database.
So while you are going for this:
enum('one','two','three','four')
You end up with this:
enum('one','two')
Windows 7 w/ MySQL 5.5
CentOS 5 w/ MySQL 5
Enum support is currently not in liquibase directly. Possibly in the liquibase-mysql extension
Is there a mysql extension under development currently or is it planned? I can't find it in the available code base, but I may be overlooking it.
I thought there was one already, but apparently it's just planned....
I'll probably try to create it during the 3.0 RC process to prove out the new diff/snapshot extensions
Fixed