Skip to content

Liquibase puts the comments on the tables instead of on the fields #1408

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

Closed
php-coder opened this issue May 24, 2020 · 6 comments
Closed

Liquibase puts the comments on the tables instead of on the fields #1408

php-coder opened this issue May 24, 2020 · 6 comments
Assignees
Labels
ADR/needed A decision has been made and it needs to be documented kind/bug
Milestone

Comments

@php-coder
Copy link
Owner

In the commit 89ba68c (#1326) I used setColumnRemarks:

<setColumnRemarks
	tableName="collections_series"
	columnName="cond"
	remarks="Example: MNH, CANCELLED" />

but after deploy, I see that it put it to the table instead of the field:

mysql> show create table collections_series;
...
| collections_series | CREATE TABLE `collections_series` (
...
  `cond` varchar(9) DEFAULT NULL,
  PRIMARY KEY (`id`),
...
) ENGINE=InnoDB AUTO_INCREMENT=91 DEFAULT CHARSET=utf8 COMMENT='Example: MNH, CANCELLED' |

Here is also related logs:

liquibase.executor.jvm.JdbcExecutor      : ALTER TABLE mystamps.collections_series COMMENT = 'Example: MNH, CANCELLED'
liquibase.changelog.ChangeSet            : Remarks set on collections_series.cond
@php-coder php-coder added kind/bug ADR/needed A decision has been made and it needs to be documented labels May 24, 2020
@php-coder php-coder added this to the 0.4.4 milestone May 24, 2020
@php-coder
Copy link
Owner Author

It seems like this is our case: liquibase/liquibase#942

@php-coder php-coder self-assigned this Jun 6, 2020
@php-coder php-coder modified the milestones: 0.4.4, next Jun 9, 2020
@php-coder php-coder modified the milestones: next, 0.4.7 Oct 24, 2021
@php-coder
Copy link
Owner Author

This bug has been fixed in 4.3.0 version and in #1526 Liquibase has been updated to 4.5.0 so now we only need to fix the data in production.

@php-coder php-coder changed the title Liquibase put the comments on the tables instead on the fields Liquibase puts the comments on the tables instead on the fields Oct 24, 2021
@php-coder php-coder changed the title Liquibase puts the comments on the tables instead on the fields Liquibase puts the comments on the tables instead of on the fields Jul 7, 2022
@php-coder
Copy link
Owner Author

Perhaps, we can play with runOnChange (https://docs.liquibase.com/concepts/changelogs/attributes/runonchange.html) to re-apply comments to a column.

@php-coder
Copy link
Owner Author

Perhaps, we can play with runOnChange

It doesn't work because migration also tries to rename a column again:

MySQLSyntaxErrorException: Unknown column 'condition' in 'collections_series'

@php-coder
Copy link
Owner Author

https://docs.liquibase.com/change-types/set-table-remarks.html can be used to drop existing comment on a table.

@php-coder
Copy link
Owner Author

The build is failing now (https://app.travis-ci.com/github/php-coder/mystamps/jobs/582181150):

ChangeLogParseException: liquibase.exception.SetupException: liquibase.exception.SetupException: Error parsing line 9 column 44 of liquibase/version/0.4.7/2022-09-08--re_apply_column_comments.xml: The string "--" is not permitted within comments

php-coder added a commit that referenced this issue Sep 8, 2022
…ment in a migration

The error was:
liquibase.exception.SetupException: Error parsing line 9 column 44 of
liquibase/version/0.4.7/2022-09-08--re_apply_column_comments.xml: The string "--" is not permitted
within comments.

Correction for 31c2fde commit.

Relate to #1408
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADR/needed A decision has been made and it needs to be documented kind/bug
Projects
None yet
Development

No branches or pull requests

1 participant