Write generated sql to a file for SchemaUpdate.

Description

I would like to export the output from SchemaUpdate to a file. This is implemented for SchemaExport but it is not implemented for SchemaUpdate.
The reason is that I don't want to execute the output from SchemaUpdate directly. Because I want to change it. For example
I want to add drop statements for some tables.
I want to change the generate alter table add column statements to alter table change column in some cases, because the name is changed and I don't want to drop the data of my column.

Could you add this improvement to Hibernate.

Can you also change the ant HibernateTool hbm2ddl
You can set an outputfilename for the case update=false and it runs SchemaExport.
But if it runs SchemaUpdate ( update=true ), then outputfilename is not used.
I would like to use this property for the improvement.

Environment

hibernate 3.1rc3
mysql

Activity

Show:
Sjoerd Takken
November 22, 2005, 5:41 PM

Here I give you the patch for SchemaUpdate.

The case I want to use is

<hibernatetool>
<configuration
configurationfile="${rootKlant}/classes/mapping/hibernate.cfg.xml">

<fileset dir="${klant.mapping}">
<include name="*/.hbm.xml"/>
</fileset>
</configuration>

<hbm2ddl destdir="${klant.ddl}" export="false"
create="false" update="true" outputfilename="alter.ddl"/>

</hibernatetool>

The property outputfilename is not used for SchemaUpdate, I would like to use it for SchemaUpdate in the case that update=true

Sjoerd Takken
November 24, 2005, 2:16 PM

This patch has no problems with CR/LF on windows if you apply it with --binary

Run this patch while standing in the hibernate-3.1 directory

patch --binary -p1 < ../SchemaUpdate.patch

Joel SCHAAL
March 24, 2006, 11:43 AM

Is this bug already fixed ?

Max Rydahl Andersen
March 24, 2006, 9:10 PM

the case has not been closed so probably no.

Petar Tahchiev
January 16, 2016, 12:09 PM

I think it's fixed. Now you can say:

Assignee

Anthony Patricio

Reporter

Sjoerd Takken

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure