No target script generated for update action when using schema-generation
Activity
Show:
Andrea Boriero April 15, 2016 at 10:20 AM
Matthias Kurz April 14, 2016 at 10:04 AM
Thanks!
Andrea Boriero April 14, 2016 at 10:02 AM
Thanks @Matthias Kurz,
I'm going to give a look..
Matthias Kurz April 14, 2016 at 9:55 AMEdited
Hi @Andrea Boriero
yes I did try this but it doesn't work. It creates the update.ddl
file, but it is empty (but the database gets updated as expected).
Andrea Boriero April 14, 2016 at 9:49 AM
Hi @Matthias Kurz
have you tried
<property name="javax.persistence.schema-generation.scripts.create-target" value="update.ddl"/>
in conjunction with
<property name="javax.persistence.schema-generation.database.action" value="update" />
<property name="javax.persistence.schema-generation.scripts.action" value="update" />
?
Fixed
Details
Details
Assignee
Andrea Boriero
Andrea BorieroReporter
Matthias Kurz
Matthias KurzComponents
Affects versions
Priority
Created April 14, 2016 at 8:58 AM
Updated June 2, 2016 at 3:51 AM
Resolved May 12, 2016 at 10:08 AM
Having following in my
persistence.xml
:<property name="javax.persistence.schema-generation.database.action" value="update" /> <property name="javax.persistence.schema-generation.scripts.action" value="update" />
then Hibernate creates/alters tables, columns, etc. like it should. That's fine.
However I can not log the used database statements anywhere!
E.g. when using
create
/drop-and-create
/drop
as actions and configure:<property name="javax.persistence.schema-generation.scripts.create-target" value="create.ddl"/> <property name="javax.persistence.schema-generation.scripts.drop-target" value="drop.ddl"/>
the
create.ddl
anddrop.dll
file gets created and contains the statements.However it seems there is no way to create such a script file when using
update
.I would expect that there should be a setting like:
<property name="javax.persistence.schema-generation.scripts.update-target" value="update.ddl"/>
but this doesn't work.
Please give us a way to generate a script file when using the
update
action, thanks!