I use JPA with EclipseLink in my Java project. In the first version of my project I have a couple of entity classes and a little program logic. This version has now been in use for a bit of time and data has been inserted by the users.
Now I have a newer version of my project where I have more entities in total and old entities have changed or partially have been replaced by others.
My question now is how to update between my first and my second version (client side) without loosing the data from the first version. I know there is the possiblity to preload a load.sql, but then my project depends on one database. My clients use both MySQL and Oracle as database.
How would I do the update? Is there any way to use JPA for it?
Thanks to @JBNizet for the answer. The result is to either use higher level libraries like Liquibase or Flyway, or to create SQL scripts and test them before execution.