HHH-16614 - Properly handling before/after tables on creation for auxiliary database objects

This commit is contained in:
Cedomir Igaly 2023-05-16 15:27:11 +02:00 committed by Christian Beikov
parent bf55736a39
commit 28bb577838
1 changed files with 2 additions and 2 deletions

View File

@ -204,7 +204,7 @@ public abstract class AbstractSchemaMigrator implements SchemaMigrator {
// Create before-table AuxiliaryDatabaseObjects
for ( AuxiliaryDatabaseObject auxiliaryDatabaseObject : database.getAuxiliaryDatabaseObjects() ) {
if ( !auxiliaryDatabaseObject.beforeTablesOnCreation()
if ( auxiliaryDatabaseObject.beforeTablesOnCreation()
&& auxiliaryDatabaseObject.appliesToDialect( dialect ) ) {
applySqlStrings(
true,
@ -275,7 +275,7 @@ public abstract class AbstractSchemaMigrator implements SchemaMigrator {
// Create after-table AuxiliaryDatabaseObjects
for ( AuxiliaryDatabaseObject auxiliaryDatabaseObject : database.getAuxiliaryDatabaseObjects() ) {
if ( auxiliaryDatabaseObject.beforeTablesOnCreation() && auxiliaryDatabaseObject.appliesToDialect( dialect ) ) {
if ( !auxiliaryDatabaseObject.beforeTablesOnCreation() && auxiliaryDatabaseObject.appliesToDialect( dialect ) ) {
applySqlStrings(
true,
auxiliaryExporter.getSqlCreateStrings( auxiliaryDatabaseObject, metadata, sqlGenerationContext ),