After some more testing, I found bug in Liquibase (or possibly MySQL, depending on how you look at it).
As you can see here, changing a data type in MySQL (without specifying NULL/NOT NULL) sets it back to Nullable:
- [root@test]# mysql -u root -e "create database TINY_SCHEMA"
[root@test]# mysql -u root -e "create table TINY_SCHEMA.TINY_TBL(COL1 BIGINT NOT NULL)"
[root@test]# mysql -u root -e "describe TINY_SCHEMA.TINY_TBL"
+-------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+------------+------+-----+---------+-------+
| COL1 | bigint(20) | NO | | NULL | |
+-------+------------+------+-----+---------+-------+
[root@test]# mysql -u root -e "alter table TINY_SCHEMA.TINY_TBL modify COL1 DECIMAL(20,0)"
[root@test]# mysql -u root -e "describe TINY_SCHEMA.TINY_TBL"
+-------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------+------+-----+---------+-------+
| COL1 | decimal(20,0) | YES | | NULL | |
+-------+---------------+------+-----+---------+-------+
and the SQL that Liquibase executes to change the type doesn’t include “NOT NULL” (just as I’ve run in the example above), even though the only thing that changed in the XML Changelog is the data type, not the nullable=“false” tag.