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

Schema generation properties not well documented #11721

Closed
ghost opened this issue Jan 22, 2018 · 4 comments
Closed

Schema generation properties not well documented #11721

ghost opened this issue Jan 22, 2018 · 4 comments
Labels
status: superseded An issue that has been superseded by another type: documentation A documentation update

Comments

@ghost
Copy link

ghost commented Jan 22, 2018

Unfortunately my previous issue #11678 was closed as duplicate, though I don't think it is one.

In the issue I argued that the documentation is not entirely clear on which of several similar properties have precedence.

The referenced issue suggest other default values of certain properties in some contexts.

I would be glad if the documentation could be improved.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 22, 2018
@snicoll
Copy link
Member

snicoll commented Jan 23, 2018

@FelixRiemann you were referring to several issues into one and the problem of not enabling create-drop with Flyway/Liquibase has been addressed already (which means you don't have to set that ddl.auto either).

As for the documentation, it is not clear what you're asking really. So please clarify and we can see what can be improved in the documentation.

In the future, please comment on a declined issue rather than creating another one. We can always refine and reopen.

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Jan 23, 2018
@ghost
Copy link
Author

ghost commented Jan 24, 2018

There are four properties I am interested in:

  • (1) spring.jpa.generate-ddl (boolean)
  • (2) spring.jpa.properties.javax.persistence.schema-generation.database.action (one of none, drop, create, drop-and-create)
  • (3) spring.jpa.hibernate.ddl-auto (one of none, validate, update, create, create-drop)
  • (4) spring.datasource.initialize (boolean)

From the documentation, the following is unclear to me:

  1. Both (1) and (2) exist to enable/disable schema generation. I would like to know which of both has precedence.
  2. Property (4) governs whether the schema should be generated from DML scripts. What happens if this is enabled together with one of (1) or (2)?
  3. Then there is (3), which is similar to (2). What happens if they contradict each other?
  4. What happens if (1) and (3) contradict each other (and here by contradict I mean any combination other than (none, none) and (true, create))?
  5. If I do not set (3) specifically, will its default value override (1)? In Spring Boot 1.5.9 this is the case, as I pointed out in Schema generation properties not well documented #11678. But even if the default value of (3) will be none when Flyway/Liquibase is detected, as suggested in Default Hibernate auto-DDL to "none" with embedded database when Flyway or Liquibase is detected #9262, the question remains whether (3) overrides (1) if I do not use (3).

In the future, please comment on a declined issue rather than creating another one. We can always refine and reopen.

Will keep that in mind.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 24, 2018
@snicoll snicoll added type: documentation A documentation update priority: low and removed status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged labels Jan 25, 2018
@philwebb philwebb added the status: ideal-for-contribution An issue that a contributor can help us with label Mar 28, 2018
m7stock added a commit to m7stock/spring-boot that referenced this issue Jan 31, 2019
@m7stock
Copy link
Contributor

m7stock commented Jan 31, 2019

What these questions have in common is that they mix different approaches. I think the documentation of their correlation would be quite complex and sometimes even beyond the control of Spring Boot itself:

Both (1) and (2) exist to enable/disable schema generation. I would like to know which of both has precedence.

spring.jpa.generate-ddl applies properties to the JPA implementation directly, i.e. hibernate.hbm2ddl.auto becomes "update" when spring.jpa.generate-ddl is true. Later, JPA 2.1 schema creation properties are evaluated by Hibernate and javax.persistence.schema-generation.database.action takes precedence over hibernate.hbm2ddl.auto unless it is unset or set to none.

Therefore, I referenced a commit that adds general notes to the documentation.

@wilkinsona wilkinsona added status: superseded An issue that has been superseded by another and removed status: ideal-for-contribution An issue that a contributor can help us with labels Jun 14, 2019
@wilkinsona
Copy link
Member

Superseded by #15859.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another type: documentation A documentation update
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants