We're updating the issue view to help you get more done. 

The generation of the drop schema does not filter sequence with schemaFilter

Description

When using SchemaExport to generate DDL, the drop schema does not rely on the SchemaFilter to filter sequences.

The suggested correction is to add a call to this filter after ligne L243

https://github.com/aleksabl/hibernate-core/blob/master/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/SchemaDropperImpl.java#L243

Current code ( SchemaDropperImpl line 243)

1 2 3 4 for ( Sequence sequence : namespace.getSequences() ) { checkExportIdentifier( sequence, exportIdentifiers ); applySqlStrings( dialect.getSequenceExporter().getSqlDropStrings( sequence, metadata ), formatter, options, targets ); }

Suggested correction :

1 2 3 4 5 6 7 for ( Sequence sequence : namespace.getSequences() ) { if ( !schemaFilter.includeSequence( sequence ) ) { continue; } checkExportIdentifier( sequence, exportIdentifiers ); applySqlStrings( dialect.getSequenceExporter().getSqlDropStrings( sequence, metadata ), formatter, options, targets ); }

Remark : this is done on the create schema in this line :

https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/SchemaCreatorImpl.java#L285

This is just a mirror correction on the drop side.

Environment

None

Status

Assignee

Andrea Boriero

Reporter

benoit besson

Suitable for new contributors

Yes, likely

Components

Fix versions

Affects versions

5.1.0
5.0.9
5.2.1

Priority

Major