-
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
Exposing the schema-generation.scripts properties in the application.properties #14771
Comments
something different than the existing |
The The In fact, in JPA, you can have both properties to generate the database schema as well as the DDL script. https://thorben-janssen.com/standardized-schema-generation-data-loading-jpa-2-1/ |
Right, so you want it to also expose configuration options to generate the
create.sql and drop.sql ?
Wondering, should we maybe generate these always by default when running in
dev mode?
…On Tue, 2 Feb 2021, 20:06 Antonio Goncalves, ***@***.***> wrote:
The quarkus.hibernate-orm.database.generation is *equivalent* to the
standard JPA javax.persistence.schema-generation.database.action
property. It has an impact on the schema generated in the database (none,
create, drop-and-create, drop).
The javax.persistence.schema-generation.scripts.action property (came
later, I think in JPA 2.1) is about the schema definition. This property
generates the DDL scripts, but does not generate the schema itself.
In fact, in JPA, you can have both properties to generate the database
schema as well as the DDL script.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#14771 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAKMTOO4YZJUANR5FCY5VDS5BLMHANCNFSM4W62XX7A>
.
|
As you know, there are several strategies when mapping objects to a DB. Existing DB, starting from scratch, entities first, DB first.... So I'm not sure generating the DDL out of the entities should be the default in dev mode. Would that mean that these values would be the default ?
Because in JPA, the default is
So, TBH, I prefer the good old JPA way (no DB schema generation, no DDL generation, and you have to change the values if needed). So, if you want to be consistent with the existing Quarkus properties, maybe something like:
Today, to get my DDL I need a
|
I'm going to take a look at this. |
Description
This follows a discussion on Zulip[1].
To generate the DDL for JPA and/or Panache entities, I can use the
schema-generation.scripts
properties in thepersistence.xml
file as follow:This works well, but I am trying to avoid using the
persistence.xml
and only use theapplication.properties
instead. I couldn't find these properties in the Quarkus documentation, so I tried several formats but none work:It looks like these properties are not exposed. It would be very nice to have them so we can get the DDL files without having the
persistence.xml
.[1] https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/Any.20way.20to.20have.20a.20scripts.2Ecreate-target.20property.20.3F
The text was updated successfully, but these errors were encountered: