hbm2ddl tools cannot generate create/update script not modifying the database

Description

hbm2ddl tools SchemaUpdate and SchemaExport provides interface to generate update/create script. Now it is not support output to script file not modifying the database.
Example: SchemaUpdate.execute(true, false) throws SchemaManagementException: BIG PROBLEM
The implemetation in Hibernate 4 receives list of update scripts from {{Configuration }}(Configuration.generateSchemaUpdateScriptList) and then apply them to output. New implemetation in Hibernate 5 uses SchemaMigrator, which firmly connected to the database.

Environment

None

Activity

Show:
Andrea Boriero
October 16, 2015, 7:18 AM

can you provide a test case?

Thanks

Anton Shashok
October 16, 2015, 1:46 PM

Test added.

I tried to find a solution myself but there was some fundamental changes.
SchemaMigrator line 180: There is check (tableInformation == null) in second tables loop. In my case it isn't big problem. All updates scripts for constraints (applyIndexes, applyUniqueKeys and applyForeignKeys) can be generated with precondition "drop if exist".

I can make this changes myself but I don't know other cases, when (tableInformation == null) realy is big problem.

Andrea Boriero
October 16, 2015, 2:20 PM

Thanks ,
I'm working on the issue.

Assignee

Andrea Boriero

Reporter

Anton Shashok

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Critical
Configure