-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hibernate hbm2ddl in application.properties is not working as mentioned #5883
Hibernate hbm2ddl in application.properties is not working as mentioned #5883
Comments
It does jump into migration. But it can't get the table information. 2019-11-30 17:39:01,817 WARN [org.hib.too.sch.int.ExceptionHandlerLoggedImpl] (main) GenerationTarget encountered exception accepting command : Error executing DDL "create table user (userType varchar(31) not null, uuid varchar(255) not null, avatarHash varchar(255), creator bit not null, email varchar(255), hashedPassword varchar(255), name varchar(255), primary key (uuid)) engine=InnoDB" via JDBC Statement: org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table user (userType varchar(31) not null, uuid varchar(255) not null, avatarHash varchar(255), creator bit not null, email varchar(255), hashedPassword varchar(255), name varchar(255), primary key (uuid)) engine=InnoDB" via JDBC Statement |
Is there any update for it? |
Any update on this? I need update ddl feature to continue my projects migration. |
So... I agree there's something fishy here. What I did to reproduce the issue. Launch a MySQL database with:
Update the
Then (once ./gradlew has been made executable):
Then run From what I can see, the map here https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/GroupedSchemaMigratorImpl.java#L65 is empty so the user table is created again and again. It looks like an ORM issue to me. @dreab8 could you have a look? |
/cc @Sanne |
Andrea confirmed it's an Hibernate ORM issue due to the usage of He's going to work on it. |
a temporary solution is to use |
The temp solution is working. Thank you so much. It keeps me on Quarkus for my project now. |
@SetoKaiba thanks for insisting and sorry about the delay! |
I have opened https://hibernate.atlassian.net/browse/HHH-13788 |
Hi @SetoKaiba , I'm trying to verify @dreab8 's fix, but couldn't find the reproducer at https://github.com/SetoKaiba/code-with-quarkus . Was it moved maybe? |
@Sanne Because I think the issue is aware. So I deleted the reproducer. I'll create one again. |
Here I uploaded a reproducer again. |
An update from the Hibernate team: we decided the previous fix attempt is insufficient; having all such jdbc metadata is actually important. Since Quarkus can't (typically) connect to the database during the build phase, we will need to provide configuration properties for each such metadata entry; that's not particularly user friendly, so we'll also want to have a reasonable default for each of these attributes - the best value for each depends on the DB vendor though, so we'll want to have the metadata defaults depend on the Dialect / Driver choice. |
Hi. What's the update for this? |
Hi @SetoKaiba , |
This is fixed in hibernate/hibernate-orm#3151 , but we'll close the Quarkus issue when we upgrade the ORM component to include the fix. |
Describe the bug
Hibernate hbm2ddl in application.properties is not working as mentioned
Expected behavior
This is mentioned in the documentation.
It should work with update.
Actual behavior
"update" not working. It would still create the tables.
To Reproduce
Steps to reproduce the behavior:
Configuration
# Add your application.properties here, if applicable.
Screenshots
(If applicable, add screenshots to help explain your problem.)
Environment (please complete the following information):
uname -a
orver
:java -version
:Additional context
(Add any other context about the problem here.)
The text was updated successfully, but these errors were encountered: