in28minutes / spring-boot-examples

Code Examples for everything thats written on www.springboottutorial.com
https://www.springboottutorial.com
1.24k stars 3.36k forks source link

Table does not exist error. #2

Open Prathemesh opened 6 years ago

Prathemesh commented 6 years ago

Where do I put the create table command?

I am asking because I am getting a "Table not found" error. I searched online wherein all the examples use schema.sql to create the table in the H2 database. Is this something you missed or is there something I am missing due to which I get the "Table not found" error?

Bushy-Given commented 6 years ago

You can set spring.jpa.hibernate.ddl-auto = create So when you run your project it will automatically create the table for you. Make sure you change it to update. After running your application so that next time you run it doesnt drop the table

AbhishekAnand01 commented 3 years ago

I have created a demo project for you please try it. Hoping this will help you.

Please clone the below repository. https://github.com/AbhishekAnand01/Test-Project.git

image

image

image