addNotNullConstraint causes "Data too long" Exception for BIT(1) fields #1054
Labels
DBMariaDB
DBMySQL
good first issue
This issue is an easy starter project for new contributors.
hacktoberfest
a month-long celebration of open-source software and Developers contribute by completing PRs
ImpactLow
Severity3
TypeBug
Milestone
Description
We forgot to add a not null constraint to a column that was added to a table in a previous changeset, so now we wanted to add that not-null constraint to said new column.
The data type of that column is BIT(1) (so basically a boolean).
Sidenote: We are using MySQL/MariaDB.
I used the following XML-changeset to add the constraint:
When we run the changeset, the following Exception is thrown:
I saw that a similar issue was already brought up in 2010 (!) on the Liquibase JIRA board here, but was apparently never fixed.
To Reproduce
Use a changeset like this:
After that, add a second changeset like this:
Then run the liquibase changeset and the mentioned Exception should be thrown.
Please specify the exact commands used, from CLI, from maven, etc.
Describe the actual problematic behavior. Include console outout if relevant, log files if available. Ensure private information is redacted.
Expected behavior
I expect the changeset to run through without issues, adding the not null constraint to the specified table and setting all NULL entries to the specified default in
defaultNullValue
.As mentioned in the comment on the linked JIRA post above, adding attributes like
defaultNullValueBoolean
would also be helpful.Screenshots
None
Additional context
None
The text was updated successfully, but these errors were encountered: