You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if updateDBSchema also added/removed table columns when fields are added and removed from the respective class. I suspect this is one of those features that sounds easy but has a lot of edge cases to be handled?
The text was updated successfully, but these errors were encountered:
This is one of those intractable problems that even the original Hibernate is unable to solve. The root of the issue is that some changes simply aren't able to be migrated automatically. Consider the following examples:
A new non-null column is added, but existing records are there and have no value for this column.
A column is changed from a double to an integer, but data already exists with fractional values.
A column is renamed. For a human this is trivial, but for a computer, it's unclear whether the old column was simply deleted and a new column was inserted, or if it is supposed to migrate data.
There are just a few simple examples, you can imagine a lot more I'm sure. For this reason, the typical workflow is to use automatic schema generation during local development, or in early stages of the project's development.
As systems enter production or have data that must be delicately preserved, automatic schema generation is disabled, and migration systems are used to make incremental changes to the DB. Systems like Flyway or Liquibase are common, but have their own trade-offs.
It would be nice if
updateDBSchema
also added/removed table columns when fields are added and removed from the respective class. I suspect this is one of those features that sounds easy but has a lot of edge cases to be handled?The text was updated successfully, but these errors were encountered: