Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My table data got deleted when i restart my spring boot application after changing the value of 'spring.jpa.hibernate.ddl-auto'

My table data got deleted when i restart my spring boot application after changing the value of 'spring.jpa.hibernate.ddl-auto' to 'create' from 'verify'. why it is so? what should i do to get my data back?

I could see some drop query executing in my IDE console. Why it happened? can someone please explain?

like image 277
Vignesh Manivasagan Avatar asked Sep 04 '18 14:09

Vignesh Manivasagan


2 Answers

Make the following change in application.properties

spring.jpa.hibernate.ddl-auto=none

like image 92
sndu Avatar answered Sep 28 '22 18:09

sndu


You can read the official document of spring-boot.And the property is related to hibernate.hbm2ddl.auto in hibernate configuration.

like image 36
高慧觉 Avatar answered Sep 28 '22 17:09

高慧觉