Reputation: 1649
I have a running JavaEE web application (WAR) whose Entities will be changed in the next version of the application. This also means structure changes in the underlying database of course.
What is the best way to keep your old data and migrate to the new Entity structure after an application rewrite?
Do I have to manually change the database structure before redeploying or are there other ways?
Upvotes: 1
Views: 152
Reputation: 393
In EclipseLink 3.4, adding persistence properties to you persitence.xml.
<property name="eclipselink.ddl-generation" value="create-or-extend-tables" />
<property name="eclipselink.ddl-generation.output-mode" value="database" />
This feature is to allow creating database tables and modify any that already exist so they match the object model.
Upvotes: 1
Reputation: 127
you would like to version control your upgrade and degrade db script with your codebase. your upgrade scripts should be able to assure the safety of your existing data. and you should always do a back up before you apply your changes. Try liquibase.
Upvotes: 0