Skip to content
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

ORM Generation error when value is update with mysql #9896

Closed
andfs opened this issue Jun 9, 2020 · 6 comments
Closed

ORM Generation error when value is update with mysql #9896

andfs opened this issue Jun 9, 2020 · 6 comments
Assignees
Labels
area/hibernate-orm Hibernate ORM kind/bug Something isn't working triage/duplicate This issue or pull request already exists

Comments

@andfs
Copy link

andfs commented Jun 9, 2020

Describe the bug
if use
quarkus.hibernate-orm.database.generation=update
with MySQL database, quarkus tries to create the schema again. Its behavior is like generation was create

Expected behavior
Quarkus should only update the schema and not recreate it.

Actual behavior
Quarkus tries to create the schema again

To Reproduce
Steps to reproduce the behavior:

  1. Setup hibernate with panache and a MySQL database
  2. configure quarkus.hibernate-orm.database.generation=update
  3. starts the app

It happens in dev and production environments.

@andfs andfs added the kind/bug Something isn't working label Jun 9, 2020
@Sanne Sanne added the area/hibernate-orm Hibernate ORM label Jun 10, 2020
@Sanne
Copy link
Member

Sanne commented Jun 10, 2020

Probably related to #5883

@tivrfoa
Copy link
Contributor

tivrfoa commented Aug 2, 2020

@Sanne
When: quarkus.hibernate-orm.database.generation = update
If one field is removed, should the schema be changed?
Because I'm testing PanacheEntity and:

  1. I removed a field;
  2. run: mvn quarkus:dev
  3. Schema remained the same.

If this is a issue, is the problem on Quarkus or Hibernate?

@Bonissauro
Copy link

Bonissauro commented Aug 3, 2020

Same behavier here. When trying to add an attribute to any entity, quarkus shows an error on console saying table cannot be recreated.

2020-08-03 10:01:01,515 WARN [org.hib.too.sch.int.ExceptionHandlerLoggedImpl] (Quarkus Main Thread) GenerationTarget encountered exception accepting command : Error executing DDL "create table Usuario (id bigint not null auto_increment, email varchar(255), nome varchar(255), senha varchar(255), primary key (id)) engine=InnoDB" via JDBC Statement: org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table Usuario (id bigint not null auto_increment, email varchar(255), nome varchar(255), senha varchar(255), primary key (id)) engine=InnoDB" via JDBC Statement

@Bonissauro
Copy link

Bonissauro commented Aug 3, 2020

Does this happen also on PostGres, folks?

@Jurricane
Copy link

I've got the same problem with quarkus 1.9.2 and mysql.

@yrodiere
Copy link
Member

yrodiere commented Aug 3, 2021

This looks like a duplicate of #5883, which was fixed in Quarkus 2.0.

At the very least, while I'm able to reproduce the problem in Quarkus 1.0, I'm not able to reproduce it in 1.13.

I'll go ahead and assume this was fixed; please reopen this issue or open another one if I'm wrong.

EDIT: And please provide a reproducer :)

@yrodiere yrodiere closed this as completed Aug 3, 2021
@yrodiere yrodiere added the triage/duplicate This issue or pull request already exists label Aug 3, 2021
@yrodiere yrodiere self-assigned this Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-orm Hibernate ORM kind/bug Something isn't working triage/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

6 participants