From 28bb5778383a6f4dc63abcfd0758aee6a3a1a443 Mon Sep 17 00:00:00 2001 From: Cedomir Igaly Date: Tue, 16 May 2023 15:27:11 +0200 Subject: [PATCH] HHH-16614 - Properly handling before/after tables on creation for auxiliary database objects --- .../tool/schema/internal/AbstractSchemaMigrator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/AbstractSchemaMigrator.java b/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/AbstractSchemaMigrator.java index 2c41a1d8fa..f21945b8af 100644 --- a/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/AbstractSchemaMigrator.java +++ b/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/AbstractSchemaMigrator.java @@ -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 ),