quarkus icon indicating copy to clipboard operation
quarkus copied to clipboard

hbm2ddl create-schemas doesn't work

Open vu-bui opened this issue 3 years ago • 1 comments

Describe the bug

The option quarkus.hibernate-orm.database.generation.create-schemas seems to doesn't work anymore since 2.6.3.Final. I'm not sure if it's caused by Hibernate upgrade or not.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

Darwin local 21.5.0 Darwin Kernel Version 21.5.0: Thu Apr 21 19:51:22 PDT 2022; root:xnu-8020.120.68.131.2~2/RELEASE_X86_64 x86_64

Output of java -version

openjdk version "11.0.15" 2022-04-19

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.6.3.Final and newer

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 7.4.2

Additional information

No response

vu-bui avatar Apr 29 '22 08:04 vu-bui

/cc @Sanne, @gsmet

quarkus-bot[bot] avatar Oct 13 '22 06:10 quarkus-bot[bot]

It seems to work in our integration tests:

https://github.com/quarkusio/quarkus/blob/d688bcf1cb178b09a1424c12b5971640da8b1f82/integration-tests/jpa-postgresql/src/main/resources/application.properties#L7

https://github.com/quarkusio/quarkus/blob/7c9966fc7aa5c7ceec6e08cfe51b04128dfe32cf/integration-tests/jpa-postgresql/src/main/java/io/quarkus/it/jpa/postgresql/Person.java#L14

https://github.com/quarkusio/quarkus/blob/7c9966fc7aa5c7ceec6e08cfe51b04128dfe32cf/integration-tests/jpa-postgresql/src/main/java/io/quarkus/it/jpa/postgresql/JPAFunctionalityTestEndpoint.java#L107-L131

Can you please provide a simple project that reproduces the problem?

Thank you.

yrodiere avatar Dec 22 '22 11:12 yrodiere

This other issue suggests the problem is only when quarkus.hibernate-orm.database.generation is set to update. Was that your case?

yrodiere avatar Jan 02 '23 08:01 yrodiere

Bump. @vu-bui Can you give us a reproducer, or at least confirm your problem is the same as this one and occurs only when quarkus.hibernate-orm.database.generation is set to update?

yrodiere avatar Jan 24 '23 07:01 yrodiere

@yrodiere Sorry for the late reply. I've created a repo here https://github.com/vu-bui/quarkus-hibernate-schema-generation.

What I found out was that quarkus.hibernate-orm.database.generation.create-schemas does not work with quarkus.hibernate-orm.database.default-schema. It works with Quarkus 2.6.2.Final and earlier.

It also works if I specifically define @Table(schema = "")

vu-bui avatar Jan 27 '23 10:01 vu-bui

Thanks a lot for the information and reproducer @vu-bui , it does seem related to some changes I'm familiar with. I will have a closer look.

yrodiere avatar Jan 30 '23 10:01 yrodiere

After some investigation, the problem seems to be upstream. I reported the problem: https://hibernate.atlassian.net/browse/HHH-16177 I will try to come up with a fix upstream. Thanks again for the reproducer, that helped a lot.

yrodiere avatar Feb 13 '23 13:02 yrodiere

The bug was fixed upstream. It will be fixed in Quarkus as soon as we upgrade to either Hibernate ORM 5.6.16.Final or Hibernate ORM 6.2.0.Final (neither was released yet).

yrodiere avatar Feb 21 '23 08:02 yrodiere

I presume this was closed with https://github.com/quarkusio/quarkus/pull/32687, I'll write test in QE test suite, so will verify it later.

michalvavrik avatar Jun 01 '23 14:06 michalvavrik

thanks @michalvavrik !

Sanne avatar Jun 01 '23 15:06 Sanne

I presume this was closed with #32687, I'll write test in QE test suite, so will verify it later.

That's right, I forgot to close this. Thanks!

yrodiere avatar Jun 02 '23 06:06 yrodiere