Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update database schema with hibernate

<property name="hibernate.hbm2ddl.auto">update</property>

i can create my database schema, it automatically add properties, constraint, key etc... But what about UPDATE the database schema? If i remove some property from my entities, hibernate doesn't remove it, or if i change some constraint, hibernate doesn't touch constraint already created...

So, there is a way to make hibernate really update the database schema?

Thanks.

like image 707
blow Avatar asked Jan 01 '11 16:01

blow


1 Answers

No there is not. hbm2ddl is not meant to do a complete management of your schema migrations. It's best if you use it only for additive changes to your schema and hand edit (the generated scripts) for anything else.

like image 128
cherouvim Avatar answered Nov 09 '22 07:11

cherouvim