Incorrect liquibase changelog generation for Column definition

  1. Create Jmix application
  2. Create new JPA entity.
  3. In Designer window for JPA entity add attribute field.
  4. Add some text in Column definition.
  5. Generate Liquibase Changelog.
  6. Go to changelog folder, in *.xml filed in changeSet the text added for Column definition is in type tag.
  7. Run liquibase changes. There is syntax error because of that incorrect text in type tag.

JPA designer window
image

liquibase *.xml changelog file:
image

Or may be column definition is not kinda a description for that column as I expect?
But why there is a mixture of types and definitions in *.xml file in this case?

Hello,

Or may be column definition is not kinda a description for that column as I expect?

Yes its part of JPA.
“Column definition” is element a of the Annotation @Column.
Usage as of specification: SQL fragment that is used when generating the DDL for the column.

Example:

@Column(name="DESC", columnDefinition="CLOB NOT NULL", table="EMP_DETAIL")
@Lob
public String getDescription() {
    return description;
}

For your other question:

But why there is a mixture of types and definitions in *.xml file in this case?

Because the standard allows for multiple ways to define types and so on.

Best Regards

2 Likes