Reputation: 2074
I have JPA table annotations and I would like to change some table names to follow a specific naming convention. The problem is that those tables are already in production. I don't like the idea of manually creating a new table and inserting the data because I have no idea how to deal with id's and associations.
What is the best way to approach this problem?
Edit: I am using hibernate.hbm2ddl.auto=update.
Upvotes: 2
Views: 821
Reputation: 153810
You need a migration production script that does an:
RENAME TABLE ....
You modify the entity table mappings to match the new table names
You do a production update that does both 1) and 2)
Upvotes: 2