Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setColumnRemarks remove default value and not null flag on MySQL #2563

Closed
marcofaion84 opened this issue Feb 21, 2022 · 1 comment
Closed

Comments

@marcofaion84
Copy link

Environment

Liquibase Version: 4.7.1

Liquibase Integration & Version: cli

Database Vendor & Version: Mysql 8.0

Operating System Type & Version: Windows 11

Description

setColumnRemarks used to update a comment on the database translate to a query that remove default value and not null flag from the target field:

ALTER TABLE database.table MODIFY COLUMN column_name VARCHAR(100) COMMENT 'comment';

If the field "column_name" has a default value or a not null flag, it will lose both after the comment update.

Steps To Reproduce

Update any database field with the following changeset, update type, columnName and tableName in the changeset:

    <changeSet author="marco" id="id-1">
        <setColumnRemarks columnDataType="boolean" columnName="column_name" remarks="comment" tableName="table"/>
    </changeSet>

Actual Behavior

setColumnRemarks remove not null flag and default value from the target column definition

Expected/Desired Behavior

setColumnRemarks should update the comment of a column without losing any other column definition.

@nvoxland
Copy link
Contributor

nvoxland commented Jul 6, 2022

Unfortunately there isn't anything we can do about that. It's a limitation of mysql/mariadb. If you are setting a comment and have more column settings besides the data type, you'll have to use or .

I created #3045 to add a warning, but that is all we are able to do.

@nvoxland nvoxland closed this as not planned Won't fix, can't repro, duplicate, stale Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants