Fixed
Details
Reporter
Manuel Rego CasasnovasManuel Rego CasasnovasComponents
Fix versions
Affects versions
Priority
Major
Details
Details
Reporter
Manuel Rego Casasnovas
Manuel Rego CasasnovasComponents
Fix versions
Affects versions
Priority
Created February 17, 2011 at 11:10 AM
Updated June 20, 2013 at 3:30 AM
Resolved September 14, 2011 at 5:32 AM
addNotNullConstraint is not working in MySQL with boolean values when there is already some record stored in table (it works properly with PostgreSQL).
For example if you have the following changeset:
<addNotNullConstraint tableName="configuration"
columnName="changed_default_admin_password"
defaultNullValue="FALSE"
columnDataType="BOOLEAN" />
It tries to execute the next UPDATE sentence:
UPDATE `configuration` SET `changed_default_admin_password` = 'FALSE' WHERE changed_default_admin_password IS NULL
But, the correct one in MySQL should be:
UPDATE `configuration` SET `changed_default_admin_password` = '0' WHERE changed_default_admin_password IS NULL
I'm attaching a patch with a possible fix for this issue.
See forum for more info: http://forum.liquibase.org/#Topic/49382000000032143