tlberglund / groovy-liquibase

Yet Another Groovy DSL for Liquibase
Other
85 stars 66 forks source link

Boolean defaultValue always interpreted as TRUE #21

Closed jeroenvs closed 13 years ago

jeroenvs commented 13 years ago

Whenever using a BOOLEAN type in a column, the default value is always interpreted as TRUE. It does not happen for other types, such as BIT or TINYINT.

column(name: "createRight", type: "BOOLEAN", defaultValue: false) { constraints(nullable: false) }

generates the following output:

HSQLDB createRight BOOLEAN DEFAULT TRUE NOT NULL

MySQL createRight tinyint(1) NOT NULL DEFAULT '1',

I've also tried other defaultValues such as 'false' "false" 0. All yield the same result.

tlberglund commented 13 years ago

Try using the property called defaultValueBoolean. This should work. It's not entirely obvious that it works this way, but the Liquibase column tag documentation covers it.