How do you manage schema upgrades to a production database?
Liquibase
liquibase.org:
- it understands hibernate definitions.
- it generates better schema update sql than hibernate
- it logs which upgrades have been made to a database
- it handles two-step changes (i.e. delete a column "foo" and then rename a different column to "foo")
- it handles the concept of conditional upgrades
- the developer actually listens to the community (with hibernate if you are not in the "in" crowd or a newbie -- you are basically ignored.)
opinion
the application should never handle a schema update. This is a disaster waiting to happen. Data outlasts the applications and as soon as multiple applications try to work with the same data ( the production app + a reporting app for example) -- chances are they will both use the same underlying company libraries... and then both programs decide to do their own db upgrade ... have fun with that mess.
I am a big fan of Red Gate products that help creating SQL packages to update database schemas. The database scripts can be added to source control to help with versioning and rollback.