Hi,
I am trying to generate a changelog file from hibernate entities for mySQL database. Entity has an enum field. The result changelog file has a correct type for this field but missing values.
Entity:
public enum PermissionAction {
CREATE,
DELETE,
EDIT,
VIEW,
}
@Entity
@Table(name = "permissions")
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
public class Permission {
@Id
@Column(insertable = false, updatable = false)
@Enumerated(EnumType.STRING)
private PermissionAction id;
}
Result Changelog:
databaseChangeLog:
- changeSet:
id: 1741866603350-1
author: Dunstic (generated)
changes:
- createTable:
columns:
- column:
constraints:
nullable: false
primaryKey: true
primaryKeyName: permissionsPK
name: id
type: ENUM
tableName: permissions
When I’m trying to update database I get an error because mySQL requires enum values to be presented for type ENUM. It should be ENUM(‘CREATE’,‘DELETE’,‘EDIT’,‘VIEW’)
How can I configure liquibase diffChangelog to add missing values for ENUM type?