quarkus: Hibernate ORM: Schema is not generated
Hey, we are playing around with quarkus. First: Thank you for your work, I like it very much.
Here is my bug: Describe the bug I noticed, that, when using a schema in an entity, hibernate orm does not create the schema which is used in @Table Annotation, even if you use create/drop-and-create as strategy. following error are, that tables cannot be created, because there is no such given schema.
Expected behavior Schema should be created before creating the tables.
Actual behavior Schema is not created. Error: Caused by: org.postgresql.util.PSQLException: ERROR: schema “myschema” does not exist when hibernate tries to create a table.
To Reproduce Steps to reproduce the behavior:
- clone the https://github.com/quarkusio/quarkus-quickstarts/tree/master/hibernate-orm-quickstart
- go the Fruit Entity and schema to @Table
- add the schema to the import.sql
- Run the *Test class
Environment (please complete the following information):
- Quarkus version or git rev: 1.7.1, also tried for 1.6.1
- Build tool (ie. output of
mvnw --version
orgradlew --version
): maven
Thanks, guys!
Bastian
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 24 (9 by maintainers)
Commits related to this issue
- Support the ability to create the schemas on database schema generation Also reorganize the `generation.` config properties in passing. Fixes #11818 — committed to gsmet/quarkus by gsmet 4 years ago
- Support the ability to create the schemas on database schema generation Also reorganize the `generation.` config properties in passing. Fixes #11818 — committed to gsmet/quarkus by gsmet 4 years ago
- Support the ability to create the schemas on database schema generation Also reorganize the `generation.` config properties in passing. Fixes #11818 — committed to gsmet/quarkus by gsmet 4 years ago
Works with quarkus.hibernate-orm.database.generation.create-schemas=true!!! Thank you for the superfast feedback and implementation.
@BastianSperrhacke-Otto in the end, I reproduced the issue and created the following PR: https://github.com/quarkusio/quarkus/pull/11901