[HHH-10640] fix wrong expected statement on DB2
This commit is contained in:
parent
971855188e
commit
df6efccd91
|
@ -16,6 +16,8 @@ import org.hibernate.boot.MetadataSources;
|
|||
import org.hibernate.boot.registry.StandardServiceRegistry;
|
||||
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
|
||||
import org.hibernate.boot.spi.MetadataImplementor;
|
||||
import org.hibernate.dialect.DB2Dialect;
|
||||
import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
|
||||
import org.hibernate.tool.hbm2ddl.SchemaExport;
|
||||
|
||||
import org.junit.After;
|
||||
|
@ -72,10 +74,16 @@ public class SchemaCreationTest {
|
|||
statement.toLowerCase().contains( "alter table element" ),
|
||||
is( false )
|
||||
);
|
||||
if ( statement.toLowerCase().startsWith( "alter table category add constraint" )
|
||||
&& statement.toLowerCase().contains( "unique (code)" ) ) {
|
||||
isUniqueConstraintCreated = true;
|
||||
|
||||
if (ssr.getService(JdbcEnvironment.class).getDialect() instanceof DB2Dialect) {
|
||||
if (statement.toLowerCase().startsWith("create unique index")
|
||||
&& statement.toLowerCase().contains("category (code)")) {
|
||||
isUniqueConstraintCreated = true;
|
||||
}
|
||||
} else {
|
||||
if (statement.toLowerCase().startsWith("alter table category add constraint")
|
||||
&& statement.toLowerCase().contains("unique (code)")) {
|
||||
isUniqueConstraintCreated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue