I have a moderate size project using Spring Boot, and I am trying to create my first DataJpaTest
with embedded H2, but I am getting the following exception:
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "drop table project.project.driver if exists" via JDBC Statemen
Caused by: org.h2.jdbc.JdbcSQLException: Schema "PROJECT" not found; SQL statement:
I have tried this and using a schema.sql, also this and using a test.properties in test/resources, and this other answer. But nothing worked. I am really baffled; this is the first time I face an issue in Spring Boot that I am not able to figure it out.
My entity classes are defined as:
@Entity
@Table(name = "table_name", schema = "project", catalog = "project")
@Lombok.Data
public class TableNameEntity { }
Any suggestion of how to force Hibernate to create the schema in H2?