We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
dataSource: url: jdbc:mysql://... driverClassName: com.mysql.cj.jdbc.Driver username: password: hibernate: hbm2ddl: auto: validate
With Micronaut Hibernate GORM, configuring hbm2ddl to validate will cause startup to fail if schema is invalid.
I found a similar ticket but I guess this is not for GORM? [https://github.com//issues/1]
class ValidatorService { @Inject HibernateDatastore hibernateDatastore void validate() { // retrieve existing metadata def metadata = hibernateDatastore.getMetadata() // throw exception on failed validation new SchemaValidator().validate(metadata) } }
and then call the validate() on startup with something like a startup listener:
void onApplicationEvent(StartupEvent event) { validator.validate() }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
With Micronaut Hibernate GORM, configuring hbm2ddl to validate will cause startup to fail if schema is invalid.
I think is useful if we can enable validation and liquibase will run the migration before the validation and not after.
I found a similar ticket but I guess this is not for GORM? [https://github.com//issues/1]
The current workaround will be to retrieve the Hibernate metadata from GORM and run the schema validator manually.
and then call the validate() on startup with something like a startup listener:
The text was updated successfully, but these errors were encountered: