У меня в настоящее время есть тип enum в моей БД, созданный с помощью liquibase со следующим сценарием:
- changeSet:
id: id_1
author: my_team
changes:
- sql: CREATE TYPE my_team.letters AS ENUM ('A', 'B', 'C')
Поскольку мне нужно добавить букву D в перечисление, я создаю новое перечисление
- changeSet:
id: id_2
author: my_team
changes:
- sql: CREATE TYPE my_team.letters_2 AS ENUM ('A', 'B', 'C', 'D')
И я обновляю тип
- changeSet:
id: id_3
author: my_team
changes:
- modifyDataType:
columnName: letter
newDataType: my_team.letters_2
schemaName: my_team
tableName: table_name
И я получаю следующую ошибку при выполнении сценариев Liquibase
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.MigrationFailedException: Migration failed for change set db/changelog/ddl-my_team-v.0.0.15.my_team::id_3::my_team team:
Reason: liquibase.exception.DatabaseException: ERROR: cannot cast type my_team.letters to my_team.letters_2
Position: 89 [Failed SQL: (0) ALTER TABLE my_team.table_name ALTER COLUMN case_status TYPE my_team.letters_2 USING (letter::my_team.letters_2)]
Я не могу понять почему, так как тип назначения включает в себя все значения оригинала.
Как это можно сделать?
Заранее спасибо,