in28minutes/spring-boot-examples

Table does not exist error.

Prathemesh opened this issue · 2 comments

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?

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

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