HHH-10203 - Overriden UniqueDelegate.getTableCreationUniqueConstraintsFragment not called anymore in SchemaExport

This commit is contained in:
Steve Ebersole 2015-11-04 16:16:11 -06:00
parent 4218f365e5
commit eadb0fec8f
2 changed files with 4 additions and 2 deletions

View File

@ -135,6 +135,8 @@ public class StandardTableExporter implements Exporter<Table> {
.append( table.getPrimaryKey().sqlConstraintString( dialect ) );
}
buf.append( dialect.getUniqueDelegate().getTableCreationUniqueConstraintsFragment( table ) );
applyTableCheck( table, buf );
buf.append( ')' );

View File

@ -72,7 +72,7 @@ public class UniqueDelegateTest extends BaseUnitTestCase {
assertThat( getAlterTableToAddUniqueKeyCommandCallCount, equalTo( 1 ) );
assertThat( getColumnDefinitionUniquenessFragmentCallCount, equalTo( 1 ) );
assertThat( getTableCreationUniqueConstraintsFragmentCallCount, equalTo( 0 ) );
assertThat( getTableCreationUniqueConstraintsFragmentCallCount, equalTo( 1 ) );
final SchemaDropper schemaDropper = ssr.getService( SchemaManagementTool.class ).getSchemaDropper( Collections.emptyMap() );
schemaDropper.doDrop( metadata, false, target );
@ -80,7 +80,7 @@ public class UniqueDelegateTest extends BaseUnitTestCase {
// unique keys are not dropped explicitly
assertThat( getAlterTableToAddUniqueKeyCommandCallCount, equalTo( 1 ) );
assertThat( getColumnDefinitionUniquenessFragmentCallCount, equalTo( 1 ) );
assertThat( getTableCreationUniqueConstraintsFragmentCallCount, equalTo( 0 ) );
assertThat( getTableCreationUniqueConstraintsFragmentCallCount, equalTo( 1 ) );
}
public static class MyDialect extends H2Dialect {