Additional column data is stripped out during modifyDataType change for BLOB, TEXT column types in MySQL
See original GitHub issueEnvironment
Liquibase Version: 4.4.0 / 4.15.0
Liquibase Integration & Version: CLI
Description
modifyDataType changesets for BLOB, TEXT types columns result in a SQL query without additional information.
Steps To Reproduce
- Create a modifyDataType changeset with a column of type BLOB
database changelog:
- changeSet:
id: test
changes:
- modifyDataType:
tableName: foo
columnName: bar
newDataType: "BLOB NOT NULL"
- Run
update-sql
Actual Behavior
MySQL statement without additional information about the column is generated.
ALTER TABLE foo MODIFY bar BLOB;
Expected/Desired Behavior
MySQL statement with additional information about the column is generated.
ALTER TABLE foo MODIFY bar BLOB NOT NULL;
Additional Context
The issue seems to caused by missing type.addAdditionalInformation(getAdditionalInformation());
call for a few types including BLOB and TEXT. The changeset works as expected for INT or VARCHAR.
Thanks!
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
11.3.4 The BLOB and TEXT Types - MySQL :: Developer Zone
For TEXT and BLOB columns, there is no padding on insert and no bytes are stripped on select. If a TEXT column is...
Read more >changelog.txt · xiaowu/liquibase-3.10.2 - Gitee.com
Improved `generateChangeLog` command to assume a `diffTypes` that includes "data" when the `dataOutputDirectory` parameter is used.
Read more >how to add to a column in sql Code Example - Code Grepper
ADD COLUMN phone VARCHAR(15) AFTER name;. 6. Code language: SQL (Structured Query Language) (sql). Source: www.mysqltutorial.org. Add a Grepper Answer ...
Read more >Chapter 4, Optimizing Schema and Data Types - O'Reilly
These data types changed greatly in versions 4.1 and 5.0, which makes them even more complicated. Since MySQL 4.1, each string column can...
Read more >mysql - Remove special characters from a database field
update mytable set FieldName = REPLACE(FieldName,'/',''). That's a good place to start.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks like this issue was also posted by @Vampire on #1763. We will continue the follow up and close the other one
@shkin Thanks will take another look and clarify/resolve