In Hibernate if we set hbm2ddl.auto to create/create-drop , then it will delete the old schema and create the new schema when starts. It means, it will delete data also?.. My doubt is if it deletes every thing then how could we retrive the old data? (eg: user registration details) and what is the correct option should use in production environments?
Pls correct me, if I am wrong.
IMHO, the only valid option for production environements is
validate. Everything else can cause potential risk of loosing data/breaking db schema due to misscofiguration, simple mistake or typo.Use migrations tools for schema updates as they provide "version controll" over your schema allowing it to be tested before depoyment, and revert the changes.