MySQL creating "boolean" columns as "bit(1)" instead of "tinyint(1)"

With Liquibase 2.x, Liquibase would create columns configured as type=“BOOLEAN” in the changelogs as “tinyint(1)” for MySQL. Since upgrading to Liquibase 3.x, it is creating those columns as “bit(1)”.


I didn’t see anything about this in the upgrade notes - is this an intended behaviour change?


The relevant line is here: https://github.com/liquibase/liquibase/blob/master/liquibase-core/src/main/java/liquibase/datatype/core/BooleanType.java#L34

It was changed because bit seemed to match the expected type for boolean better than tinyint did. It should have been in the upgrade notes but must have been missed.


Is it causing problems for you?

Nathan

MySQL itself maps “BOOLEAN” to “TINYINT(1)”.

Thats a much better solution to rely on their mapping than your own.

Can it be changed in a next version?

I agree with the comment above, BOOLEAN should be a TINYINT(1) in MySQL since that is the default mapping. The current behavior doesn’t work, even the mysql command line is confused and shows random chars