Few days ago I switched my Java Spring Boot project from Hibernate ORM 6.1.7 to Hibernate ORM 6.2.1. The underlying database is MySQL 8 which supports enum data type. In one of my entities I have `enum` which is annotated by @Enumerated(EnumType.STRING) and so far it was working as expected - varchar table column was created by Hibernate few years ago.
After switching to Hibernate ORM 6.2.1 this table column was converted to MySQL’s enum data type. When I try to start my app with spring.jpa.hibernate.ddl-auto set to validate - an exception is thrown:
If I change ddl-auto setting to update or none, the table column of enum type stays as it is and application can boot up. Steps are:
- spring.jpa.hibernate.ddl-auto = update
- run the app
- database is updated
- stop the app
- spring.jpa.hibernate.ddl-auto = validate
- run the app
- exception is thrown
Hibernate Discourse post: https://discourse.hibernate.org/t/hibernate-validate-fails-on-enum/7535 |