2
See my application.. properties file:
spring.jpa.database=POSTGRESQL
spring.datasource.platform=postgres
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create-drop
spring.database.driverClassName=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/money?createDatabaseIfNotExist=true&useSSL=false
spring.datasource.username=postgres
spring.datasource.password=1234
What’s happening is that every time I run the project it drops into the table and then creates the table all over again, and with that it erases all the records that exist in the database as you can see below;
This below is a log of Springtools, it is because my project is a Spring Boot
Hibernate: drop table if exists categoria cascade
Hibernate: create table categoria (codigo bigserial not null, nome varchar(255), primary key (codigo))
[2m2017-11-14 13:24:14.127[0;39m [32m INFO[0;39m [35m4076[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36morg.hibernate.tool.hbm2ddl.SchemaExport [0;39m [2m:[0;39m HHH000230: Schema export complete
How do I set up the file not to do this?
I tried with this piece of code, but I was unsuccessful.
?createDatabaseIfNotExist=true&useSSL=false
How it works Hibernate.hbm2ddl.auto?
– rray