2
Good afternoon.
I would like to know and confirm if you have any way to update table and column definitions in each schema using Hibernate.
For now, what I’ve seen so far is that Hibernate only creates tables and columns, but does not delete or modify their settings, such as the size of a field.
I have already implemented Flyway in the application and it is working correctly, but the idea is that this is done without creating an SQL script to go through the schemas and that Hibernate identifies the definitions that need to be changed, tables and fields that need to be created and that apply in the database for each schema.
Thank you in advance.
I understand this Hibernate feature to create or update database schema more as a resource time design (where if something goes wrong or at each test you simply recreate the base from scratch) than to upgrade bases in production or even UAT. I don’t think it’s the function of the application to update your database because unfortunately this is not trivial or risk-free. Updating the database should be one of the application version update tasks - it can and should be automated, but it should be done by a tool specialized in this (not the case of Hibernate).
– Caffé