diff --git a/README.md b/README.md
index d82dc5017..c00cb73e5 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,6 @@
[](https://github.com/ebean-orm/ebean/blob/master/LICENSE)
[](https://github.com/ebean-orm/ebean/actions/workflows/multi-jdk-build.yml)
[](https://github.com/ebean-orm/ebean/actions/workflows/jdk-18-ea.yml)
-[](https://github.com/ebean-orm/ebean/actions/workflows/jdk-ea.yml)
[](https://github.com/ebean-orm/ebean/actions/workflows/h2database.yml)
[](https://github.com/ebean-orm/ebean/actions/workflows/postgres.yml)
@@ -12,6 +11,15 @@
[](https://github.com/ebean-orm/ebean/actions/workflows/sqlserver.yml)
[](https://github.com/ebean-orm/ebean/actions/workflows/yugabyte.yml)
+
+#### Builds against EA (Early Access) versions of Java (19, Loom, panama etc)
+
+[](https://github.com/ebean-orm/ebean/actions/workflows/jdk-ea.yml)
+[](https://github.com/ebean-orm/ebean-datasource/actions/workflows/jdk-ea.yml)
+[](https://github.com/ebean-orm/ebean-migration/actions/workflows/jdk-ea.yml)
+[](https://github.com/ebean-orm/ebean-test-docker/actions/workflows/jdk-ea.yml)
+
+
# Sponsors
-# Need help?
+## Need help?
Post questions or issues to the Ebean google group - https://groups.google.com/forum/#!forum/ebean
-# Documentation
+## Documentation
Goto [https://ebean.io/docs/](https://ebean.io/docs/)
-## Maven central links:
-[Maven central - ebean](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.ebean%22%20AND%20a%3A%22ebean%22 "maven central ebean")
-
-[Maven central - all related projects](http://search.maven.org/#search%7Cga%7C1%7Cebean "maven central all related projects")
+## Maven central
+[Maven central - io.ebean](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.ebean%22%20)
-## Early access builds
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/BaseTableDdl.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/BaseTableDdl.java
index f000104fd..c44795191 100644
--- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/BaseTableDdl.java
+++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/BaseTableDdl.java
@@ -4,7 +4,6 @@ import io.ebean.annotation.Platform;
import io.ebean.config.DatabaseConfig;
import io.ebean.config.DbConstraintNaming;
import io.ebean.config.NamingConvention;
-import io.ebean.config.dbplatform.DbHistorySupport;
import io.ebean.config.dbplatform.IdType;
import io.ebean.util.StringHelper;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer;
@@ -62,7 +61,7 @@ public class BaseTableDdl implements TableDdl {
private final boolean strictMode;
- private final boolean alterHistoryTables;
+ private final PlatformHistoryDdl.TableBased tableHistory;
/**
* Helper class that is used to execute the migration ddl before and after the migration action.
@@ -181,11 +180,10 @@ public class BaseTableDdl implements TableDdl {
this.platformDdl = platformDdl;
this.platformDdl.configure(config);
this.strictMode = config.isDdlStrictMode();
- DbHistorySupport hist = platformDdl.getPlatform().getHistorySupport();
- if (hist == null) {
- this.alterHistoryTables = false;
+ if (platformDdl.historyDdl instanceof PlatformHistoryDdl.TableBased) {
+ this.tableHistory = (PlatformHistoryDdl.TableBased) platformDdl.historyDdl;
} else {
- this.alterHistoryTables = platformDdl.historyDdl.alterHistoryTables();
+ this.tableHistory = null;
}
}
@@ -634,8 +632,8 @@ public class BaseTableDdl implements TableDdl {
if (isTrue(addColumn.isWithHistory())) {
platformDdl.regenerateHistoryTriggers(writer, tableName);
// make same changes to the history table
- if (alterHistoryTables) {
- String historyTable = historyTable(tableName);
+ if (tableHistory != null) {
+ String historyTable = tableHistory.historyTableName(tableName);
for (Column column : columns) {
alterTableAddColumn(writer, historyTable, column, true, true);
}
@@ -694,8 +692,8 @@ public class BaseTableDdl implements TableDdl {
if (isTrue(dropColumn.isWithHistory())) {
platformDdl.regenerateHistoryTriggers(writer, tableName);
// also drop from the history table
- if (alterHistoryTables) {
- alterTableDropColumn(writer, historyTable(tableName), dropColumn.getColumnName());
+ if (tableHistory != null) {
+ alterTableDropColumn(writer, tableHistory.historyTableName(tableName), dropColumn.getColumnName());
}
}
}
@@ -773,13 +771,6 @@ public class BaseTableDdl implements TableDdl {
platformDdl.addColumnComment(writer.applyPostAlter(), alterColumn.getTableName(), alterColumn.getColumnName(), alterColumn.getComment());
}
- /**
- * Return the name of the history table given the base table name.
- */
- protected String historyTable(String baseTable) {
- return naming.normaliseTable(baseTable) + historyTableSuffix;
- }
-
/**
* alter all the base attributes (type/default/notnull) of the column together.
* Some platforms (like mysql/sqlserver/hana) must do that in one statement,
@@ -800,9 +791,9 @@ public class BaseTableDdl implements TableDdl {
}
if (applyToHistory) {
platformDdl.regenerateHistoryTriggers(writer, alter.getTableName());
- if (alterHistoryTables) {
+ if (tableHistory != null) {
AlterColumn alterHistoryColumn = new AlterColumn();
- alterHistoryColumn.setTableName(historyTable(alter.getTableName()));
+ alterHistoryColumn.setTableName(tableHistory.historyTableName(alter.getTableName()));
alterHistoryColumn.setColumnName(alter.getColumnName());
// ignore default value (not needed on history tables)
alterHistoryColumn.setCurrentType(alter.getCurrentType());
diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/DB2Ddl.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/DB2Ddl.java
index e88c78a67..e0eea9377 100644
--- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/DB2Ddl.java
+++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/DB2Ddl.java
@@ -104,15 +104,21 @@ public class DB2Ddl extends PlatformDdl {
+ "\n" + dropIndex(uniqueConstraintName, tableName);
}
+ private void assertNoSchema(String objName) {
+ if (objName.indexOf('.') != -1) {
+ throw new UnsupportedOperationException("Schemas are not yet supported. ObjectName: '" + objName + "'");
+ }
+ }
@Override
public String alterTableDropConstraint(String tableName, String constraintName) {
+ assertNoSchema(tableName);
StringBuilder sb = new StringBuilder(300);
sb.append("delimiter $$\n")
.append("begin\n")
- .append("if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = '")
+ .append("if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = '")
.append(maxConstraintName(constraintName).toUpperCase())
- .append("' and tabname = '").append(naming.normaliseTable(tableName).toUpperCase()).append("') then\n")
+ .append("' and ucase(tabname) = '").append(naming.normaliseTable(tableName).toUpperCase()).append("') then\n")
.append(" prepare stmt from 'alter table ").append(tableName)
.append(" drop constraint ").append(maxConstraintName(constraintName)).append("';\n")
@@ -126,10 +132,11 @@ public class DB2Ddl extends PlatformDdl {
@Override
public String dropIndex(String indexName, String tableName, boolean concurrent) {
+ assertNoSchema(indexName);
StringBuilder sb = new StringBuilder(300);
sb.append("delimiter $$\n")
.append("begin\n")
- .append("if exists (select indname from syscat.indexes where indschema = current_schema and indname = '")
+ .append("if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = '")
.append(maxConstraintName(indexName).toUpperCase()).append("') then\n")
.append(" prepare stmt from 'drop index ").append(maxConstraintName(indexName)).append("';\n")
.append(" execute stmt;\n")
@@ -140,10 +147,11 @@ public class DB2Ddl extends PlatformDdl {
@Override
public String dropSequence(String sequenceName) {
+ assertNoSchema(sequenceName);
StringBuilder sb = new StringBuilder(300);
sb.append("delimiter $$\n");
sb.append("begin\n");
- sb.append("if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = '")
+ sb.append("if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = '")
.append(maxConstraintName(sequenceName).toUpperCase()).append("') then\n");
sb.append(" prepare stmt from 'drop sequence ").append(maxConstraintName(sequenceName)).append("';\n");
sb.append(" execute stmt;\n");
diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/Db2HistoryDdl.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/Db2HistoryDdl.java
index fa11e4899..d246be8b8 100644
--- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/Db2HistoryDdl.java
+++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/Db2HistoryDdl.java
@@ -1,7 +1,6 @@
package io.ebeaninternal.dbmigration.ddlgeneration.platform;
import io.ebean.config.DatabaseConfig;
-import io.ebean.config.DbConstraintNaming;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlAlterTable;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite;
@@ -14,29 +13,24 @@ import io.ebeaninternal.dbmigration.model.MTable;
*
* @author Roland Praml, FOCONIS AG
*/
-public class Db2HistoryDdl implements PlatformHistoryDdl {
+public class Db2HistoryDdl extends DbTableBasedHistoryDdl implements PlatformHistoryDdl {
private String systemPeriodStart;
private String systemPeriodEnd;
private String transactionId;
- private PlatformDdl platformDdl;
- private DbConstraintNaming constraintNaming;
- private String historySuffix;
@Override
public void configure(DatabaseConfig config, PlatformDdl platformDdl) {
+ super.configure(config, platformDdl);
this.systemPeriodStart = config.getAsOfSysPeriod() + "_start";
this.systemPeriodEnd = config.getAsOfSysPeriod() + "_end";
this.transactionId = config.getAsOfSysPeriod() + "_txn"; // required for DB2
- this.platformDdl = platformDdl;
- this.constraintNaming = config.getConstraintNaming();
- this.historySuffix = config.getHistoryTableSuffix();
}
@Override
public void createWithHistory(DdlWrite writer, MTable table) {
String tableName = table.getName();
- String historyTableName = historyTable(tableName);
+ String historyTableName = historyTableName(tableName);
// DB2 requires an EXACT copy (same column types with null/non-null, same order)
addSysPeriodColumns(writer, tableName);
@@ -85,7 +79,7 @@ public class Db2HistoryDdl implements PlatformHistoryDdl {
platformDdl.alterTableDropColumn(writer, baseTable, transactionId);
// drop the history table
- writer.applyPostAlter().append("drop table ").append(historyTable(baseTable)).endOfStatement();
+ writer.applyPostAlter().append("drop table ").append(historyTableName(baseTable)).endOfStatement();
}
@Override
@@ -97,10 +91,6 @@ public class Db2HistoryDdl implements PlatformHistoryDdl {
createWithHistory(writer, table);
}
- @Override
- public boolean alterHistoryTables() {
- return true;
- }
@Override
public void updateTriggers(DdlWrite writer, String tableName) {
@@ -118,11 +108,7 @@ public class Db2HistoryDdl implements PlatformHistoryDdl {
}
public void enableSystemVersioning(DdlBuffer apply, String tableName) {
- apply.append("alter table ").append(tableName).append(" add versioning use history table ").append(historyTable(tableName)).endOfStatement();
- }
-
- protected String historyTable(String tableName) {
- return constraintNaming.normaliseTable(tableName) + historySuffix;
+ apply.append("alter table ").append(tableName).append(" add versioning use history table ").append(historyTableName(tableName)).endOfStatement();
}
}
diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/DbTableBasedHistoryDdl.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/DbTableBasedHistoryDdl.java
new file mode 100644
index 000000000..4d7b0deca
--- /dev/null
+++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/DbTableBasedHistoryDdl.java
@@ -0,0 +1,44 @@
+package io.ebeaninternal.dbmigration.ddlgeneration.platform;
+
+import io.ebean.config.DatabaseConfig;
+import io.ebean.config.DbConstraintNaming;
+
+/**
+ * Base implementation for all histories, where we must maintain history table (trigger based, db2 and hana)
+ *
+ * @author Roland Praml, FOCONIS AG
+ *
+ */
+public abstract class DbTableBasedHistoryDdl implements PlatformHistoryDdl.TableBased {
+
+ private DbConstraintNaming constraintNaming;
+ private String historySuffix;
+ protected PlatformDdl platformDdl;
+
+ @Override
+ public void configure(DatabaseConfig config, PlatformDdl platformDdl) {
+ this.platformDdl = platformDdl;
+ this.historySuffix = config.getHistoryTableSuffix();
+ this.constraintNaming = config.getConstraintNaming();
+ }
+
+ @Override
+ public String historyTableName(String baseTableName) {
+ return normalise(baseTableName, historySuffix);
+ }
+
+ protected String normalise(String tableName, String suffix) {
+ String normalized = quote(normalise(tableName) + suffix);
+ int lastPeriod = tableName.lastIndexOf('.');
+ return tableName.substring(0, lastPeriod + 1) + normalized;
+ }
+
+ protected String normalise(String tableName) {
+ return constraintNaming.normaliseTable(tableName);
+ }
+
+ protected String quote(String dbName) {
+ return platformDdl.quote(dbName);
+ }
+
+}
diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/DbTriggerBasedHistoryDdl.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/DbTriggerBasedHistoryDdl.java
index 1fbe97c15..4efda29bd 100644
--- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/DbTriggerBasedHistoryDdl.java
+++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/DbTriggerBasedHistoryDdl.java
@@ -1,7 +1,6 @@
package io.ebeaninternal.dbmigration.ddlgeneration.platform;
import io.ebean.config.DatabaseConfig;
-import io.ebean.config.DbConstraintNaming;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlAlterTable;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite;
@@ -15,18 +14,14 @@ import java.util.List;
/**
* Uses DB triggers to maintain a history table.
*/
-public abstract class DbTriggerBasedHistoryDdl implements PlatformHistoryDdl {
-
- protected DbConstraintNaming constraintNaming;
-
- protected PlatformDdl platformDdl;
+public abstract class DbTriggerBasedHistoryDdl extends DbTableBasedHistoryDdl implements PlatformHistoryDdl {
protected String sysPeriod;
protected String sysPeriodStart;
protected String sysPeriodEnd;
protected String viewSuffix;
- protected String historySuffix;
+
protected String sysPeriodType = "datetime(6)";
protected String now = "now(6)";
@@ -37,11 +32,9 @@ public abstract class DbTriggerBasedHistoryDdl implements PlatformHistoryDdl {
@Override
public void configure(DatabaseConfig config, PlatformDdl platformDdl) {
- this.platformDdl = platformDdl;
+ super.configure(config, platformDdl);
this.sysPeriod = config.getAsOfSysPeriod();
this.viewSuffix = config.getAsOfViewSuffix();
- this.historySuffix = config.getHistoryTableSuffix();
- this.constraintNaming = config.getConstraintNaming();
this.sysPeriodStart = sysPeriod + "_start";
this.sysPeriodEnd = sysPeriod + "_end";
@@ -121,33 +114,24 @@ public abstract class DbTriggerBasedHistoryDdl implements PlatformHistoryDdl {
protected abstract void dropTriggers(DdlBuffer buffer, String baseTable);
-
- protected String normalise(String tableName) {
- return constraintNaming.normaliseTable(tableName);
- }
-
- protected String historyTableName(String baseTableName) {
- return quote(normalise(baseTableName) + historySuffix);
- }
-
protected String historyViewName(String baseTableName) {
- return quote(normalise(baseTableName) + viewSuffix);
+ return normalise(baseTableName, viewSuffix);
}
protected String procedureName(String baseTableName) {
- return normalise(baseTableName) + "_history_version";
+ return normalise(baseTableName, "_history_version");
}
protected String triggerName(String baseTableName) {
- return normalise(baseTableName) + "_history_upd";
+ return normalise(baseTableName, "_history_upd");
}
protected String updateTriggerName(String baseTableName) {
- return normalise(baseTableName) + "_history_upd";
+ return normalise(baseTableName, "_history_upd");
}
protected String deleteTriggerName(String baseTableName) {
- return normalise(baseTableName) + "_history_del";
+ return normalise(baseTableName, "_history_del");
}
protected void addSysPeriodColumns(DdlWrite writer, String baseTableName, String whenCreatedColumn) {
@@ -266,12 +250,5 @@ public abstract class DbTriggerBasedHistoryDdl implements PlatformHistoryDdl {
return table.allHistoryColumns(true);
}
- @Override
- public boolean alterHistoryTables() {
- return true;
- }
- protected String quote(String dbName) {
- return platformDdl.quote(dbName);
- }
}
diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/HanaHistoryDdl.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/HanaHistoryDdl.java
index d8877e596..742f23c45 100644
--- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/HanaHistoryDdl.java
+++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/HanaHistoryDdl.java
@@ -1,7 +1,6 @@
package io.ebeaninternal.dbmigration.ddlgeneration.platform;
import io.ebean.config.DatabaseConfig;
-import io.ebean.config.DbConstraintNaming;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlAlterTable;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite;
@@ -12,21 +11,16 @@ import io.ebeaninternal.dbmigration.model.MTable;
import java.util.Collection;
-public class HanaHistoryDdl implements PlatformHistoryDdl {
+public class HanaHistoryDdl extends DbTableBasedHistoryDdl implements PlatformHistoryDdl {
private String systemPeriodStart;
private String systemPeriodEnd;
- private PlatformDdl platformDdl;
- private DbConstraintNaming constraintNaming;
- private String historySuffix;
@Override
public void configure(DatabaseConfig config, PlatformDdl platformDdl) {
+ super.configure(config, platformDdl);
this.systemPeriodStart = config.getAsOfSysPeriod() + "_start";
this.systemPeriodEnd = config.getAsOfSysPeriod() + "_end";
- this.platformDdl = platformDdl;
- this.constraintNaming = config.getConstraintNaming();
- this.historySuffix = config.getHistoryTableSuffix();
}
@Override
@@ -95,11 +89,6 @@ public class HanaHistoryDdl implements PlatformHistoryDdl {
createWithHistory(writer, table);
}
- @Override
- public boolean alterHistoryTables() {
- return true;
- }
-
@Override
public void updateTriggers(DdlWrite writer, String tableName) {
DdlAlterTable alter = platformDdl.alterTable(writer, tableName);
@@ -140,8 +129,5 @@ public class HanaHistoryDdl implements PlatformHistoryDdl {
apply.endOfStatement();
}
- protected String historyTableName(String tableName) {
- return constraintNaming.normaliseTable(tableName) + historySuffix;
- }
}
diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PlatformHistoryDdl.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PlatformHistoryDdl.java
index 4dd1dec6d..dc027055e 100644
--- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PlatformHistoryDdl.java
+++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PlatformHistoryDdl.java
@@ -31,14 +31,6 @@ public interface PlatformHistoryDdl {
*/
void addHistoryTable(DdlWrite writer, AddHistoryTable addHistoryTable);
- /**
- * Returns true, if alters on the live tables should be applied also to the history tables. This is required for DbTriggerBased
- * histories or on platforms like Hana, which are not SQL2011 history compatible (at least from DDL perspective)
- */
- default boolean alterHistoryTables() {
- return false;
- }
-
/**
* Regenerate the history triggers/stored function due to column added/dropped/included or excluded.
*
@@ -47,4 +39,15 @@ public interface PlatformHistoryDdl {
default void updateTriggers(DdlWrite writer, String tableName) {
// nop
}
+
+ /**
+ * When history is table based, then alters on the live tables are applied also to the history tables. This is required for
+ * DbTriggerBased histories or on platforms like Hana, which are not SQL2011 history compatible (at least from DDL perspective)
+ */
+ interface TableBased extends PlatformHistoryDdl {
+ /**
+ * Returns the history table name with propert quotes.
+ */
+ public String historyTableName(String baseTableName);
+ }
}
diff --git a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PostgresHistoryDdl.java b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PostgresHistoryDdl.java
index 4a54edd92..3aace9f58 100644
--- a/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PostgresHistoryDdl.java
+++ b/ebean-ddl-generator/src/main/java/io/ebeaninternal/dbmigration/ddlgeneration/platform/PostgresHistoryDdl.java
@@ -107,4 +107,23 @@ public class PostgresHistoryDdl extends DbTriggerBasedHistoryDdl {
buffer.append(");").newLine();
}
+ @Override
+ protected String procedureName(String baseTableName) {
+ return normalise(baseTableName) + "_history_version";
+ }
+
+ @Override
+ protected String triggerName(String baseTableName) {
+ return normalise(baseTableName) + "_history_upd";
+ }
+
+ @Override
+ protected String updateTriggerName(String baseTableName) {
+ return normalise(baseTableName) + "_history_upd";
+ }
+
+ @Override
+ protected String deleteTriggerName(String baseTableName) {
+ return normalise(baseTableName) + "_history_del";
+ }
}
diff --git a/ebean-test/src/test/java/io/ebeaninternal/dbmigration/DbMigrationTest.java b/ebean-test/src/test/java/io/ebeaninternal/dbmigration/DbMigrationTest.java
index 9174772fe..16c017c69 100644
--- a/ebean-test/src/test/java/io/ebeaninternal/dbmigration/DbMigrationTest.java
+++ b/ebean-test/src/test/java/io/ebeaninternal/dbmigration/DbMigrationTest.java
@@ -14,8 +14,10 @@ import org.junit.jupiter.api.Test;
import java.io.File;
import java.io.IOException;
import java.net.URL;
+import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -60,35 +62,38 @@ public class DbMigrationTest extends BaseTestCase {
((ConnectionPool)server().dataSource()).offline();
((ConnectionPool)server().dataSource()).online();
cleanup("migtest_ckey_assoc",
- "migtest_ckey_detail",
- "migtest_ckey_parent",
- "migtest_e_basic",
- "migtest_e_enum",
- "migtest_e_history",
- "migtest_e_history2",
- "migtest_e_history3",
- "migtest_e_history4",
- "migtest_e_history5",
- "migtest_e_history6",
- "migtest_e_ref",
- "migtest_e_softdelete",
- "migtest_e_user",
- "migtest_fk_cascade",
- "migtest_fk_cascade_one",
- "migtest_fk_none",
- "migtest_fk_none_via_join",
- "migtest_fk_one",
- "migtest_fk_set_null",
- "migtest_mtm_c",
- "migtest_mtm_m",
- "migtest_mtm_m_phone_numbers",
- "migtest_mtm_c_migtest_mtm_m",
- "migtest_mtm_m_migtest_mtm_c",
- "migtest_oto_child",
- "migtest_oto_master",
- "table",
- "\"table\"",
- "`table`");
+ "migtest_ckey_detail",
+ "migtest_ckey_parent",
+ "migtest_e_basic",
+ "migtest_e_enum",
+ "migtest_e_history",
+ "migtest_e_history2",
+ "migtest_e_history3",
+ "migtest_e_history4",
+ "migtest_e_history5",
+ "migtest_e_history6",
+ "migtest_e_ref",
+ "migtest_e_softdelete",
+ "migtest_e_user",
+ "migtest_fk_cascade",
+ "migtest_fk_cascade_one",
+ "migtest_fk_none",
+ "migtest_fk_none_via_join",
+ "migtest_fk_one",
+ "migtest_fk_set_null",
+ "migtest_mtm_c",
+ "migtest_mtm_m",
+ "migtest_mtm_m_phone_numbers",
+ "migtest_mtm_c_migtest_mtm_m",
+ "migtest_mtm_m_migtest_mtm_c",
+ "migtest_oto_child",
+ "migtest_oto_master",
+ "`migtest_QuOtEd`",
+ "migtest_QuOtEd",
+ "\"migtest_QuOtEd\"",
+ "table",
+ "\"table\"",
+ "`table`");
((ConnectionPool)server().dataSource()).offline();
((ConnectionPool)server().dataSource()).online();
@@ -100,8 +105,17 @@ public class DbMigrationTest extends BaseTestCase {
runScript("I__create_tablespaces.sql");
}
+ if (!isOracle()) {
+ // oracle.getMetaData is too slow. So skip this test
+ assertThat(getTables()).doesNotContain("migtest_QuOtEd");
+ }
runScript("1.0__initial.sql");
-
+ if (!isOracle()) {
+ assertThat(getTables()) // we expect exact spelling here
+ .contains("migtest_QuOtEd")
+ .doesNotContain("migtest_quoted")
+ .doesNotContain("MIGTEST_QUOTED");
+ }
if (isClickHouse()) {
// ClickHouse does not support transactions, so we cannot do update statements
// Add column is also not implemented. So exit here
@@ -164,7 +178,10 @@ public class DbMigrationTest extends BaseTestCase {
return;
}
runScript("1.2__dropsFor_1.1.sql");
-
+ if (!isOracle()) {
+ // too slow!
+ assertThat(getTables()).doesNotContain("migtest_QuOtEd");
+ }
// Oracle caches the statement and does not detect schema change. It fails with
// an ORA-01007
result = server().sqlQuery("select * from migtest_e_basic order by id,status").findList();
@@ -349,4 +366,15 @@ public class DbMigrationTest extends BaseTestCase {
server().script().runScript("cleanup", sb.toString(), true);
server().script().runScript("cleanup", sb.toString(), true);
}
+
+ private List getTables() throws SQLException {
+ List ret = new ArrayList<>();
+ try (Transaction txn = server().beginTransaction()) {
+ ResultSet rs = txn.connection().getMetaData().getTables(null, null, null, null);
+ while (rs.next()) {
+ ret.add(rs.getString(3));
+ }
+ }
+ return ret;
+ }
}
diff --git a/ebean-test/src/test/java/misc/migration/v1_0/EQuoted.java b/ebean-test/src/test/java/misc/migration/v1_0/EQuoted.java
new file mode 100644
index 000000000..116094997
--- /dev/null
+++ b/ebean-test/src/test/java/misc/migration/v1_0/EQuoted.java
@@ -0,0 +1,35 @@
+package misc.migration.v1_0;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import io.ebean.annotation.EnumValue;
+import io.ebean.annotation.Index;
+
+// table with upper and lower case letters
+@Table(name = "`migtest_QuOtEd`")
+@Entity
+public class EQuoted {
+
+ public enum Status {
+ @EnumValue("N")
+ NEW,
+
+ @EnumValue("A")
+ ACTIVE,
+
+ @EnumValue("I")
+ INACTIVE,
+ }
+
+ @Id
+ private String id;
+
+ @Index
+ private Status status1;
+
+ @Index(unique = true)
+ private Status status2;
+
+}
diff --git a/ebean-test/src/test/java/misc/migration/v1_2/EQuoted.java b/ebean-test/src/test/java/misc/migration/v1_2/EQuoted.java
new file mode 100644
index 000000000..6832092bf
--- /dev/null
+++ b/ebean-test/src/test/java/misc/migration/v1_2/EQuoted.java
@@ -0,0 +1,35 @@
+package misc.migration.v1_2;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import io.ebean.annotation.EnumValue;
+import io.ebean.annotation.Index;
+
+//table with upper and lower case letters
+@Table(name = "`migtest_QuOtEd`")
+@Entity
+public class EQuoted {
+
+ public enum Status {
+ @EnumValue("N")
+ NEW,
+
+ @EnumValue("A")
+ ACTIVE,
+
+ @EnumValue("I")
+ INACTIVE,
+ }
+
+ @Id
+ private String id;
+
+ @Index
+ private Status status1;
+
+ @Index(unique = true)
+ private Status status2;
+
+}
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.0__initial.sql
index 976eaa3cd..f98c28775 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.0__initial.sql
@@ -105,6 +105,12 @@ create table migtest_e_history6 (
test_number2 UInt32
) ENGINE = Log();
+create table "migtest_QuOtEd" (
+ id String,
+ status1 String,
+ status2 String
+) ENGINE = Log();
+
create table migtest_e_ref (
id UInt32,
name String
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.2__dropsFor_1.1.sql
index 4ec79a34c..cb6860e63 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.2__dropsFor_1.1.sql
@@ -7,4 +7,5 @@ alter table migtest_e_basic drop column eref_id;
alter table migtest_e_history2 drop column obsolete_string1;
alter table migtest_e_history2 drop column obsolete_string2;
-- apply post alter
+drop table if exists "migtest_QuOtEd";
drop table if exists migtest_e_ref;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.3.sql
index 1d1e765bc..b36ae5ab1 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/1.3.sql
@@ -9,6 +9,12 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4;
alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5;
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
-- apply changes
+create table "migtest_QuOtEd" (
+ id String,
+ status1 String,
+ status2 String
+) ENGINE = Log();
+
create table migtest_e_ref (
id UInt32,
name String
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/idx_clickhouse.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/idx_clickhouse.migrations
index e6e04dafd..2827022f5 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/idx_clickhouse.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/clickhouse/idx_clickhouse.migrations
@@ -1,6 +1,6 @@
-863321871, 1.0__initial.sql
+235371332, 1.0__initial.sql
1903846331, 1.1.sql
-1279151426, 1.2__dropsFor_1.1.sql
-1630693278, 1.3.sql
+688811494, 1.2__dropsFor_1.1.sql
+1015552567, 1.3.sql
80209848, 1.4__dropsFor_1.3.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.0__initial.sql
index faa10a8c2..71fc29b04 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.0__initial.sql
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -190,4 +200,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index ix_table_from on "table" ("from");
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.1.sql
index 785bcda3a..61a412b39 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.1.sql
@@ -9,6 +9,7 @@ drop index uq_migtest_e_basic_indextest6 cascade;
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
drop index if exists ix_migtest_e_basic_indextest1;
drop index if exists ix_migtest_e_basic_indextest5;
+drop index if exists ix_migtest_quoted_status1;
-- apply changes
create table migtest_e_user (
id integer generated by default as identity not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.2__dropsFor_1.1.sql
index e3450aa6a..44f13ac12 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.2__dropsFor_1.1.sql
@@ -7,5 +7,6 @@ alter table migtest_e_basic drop column eref_id;
alter table migtest_e_history2 drop column obsolete_string1;
alter table migtest_e_history2 drop column obsolete_string2;
-- apply post alter
+drop table if exists "migtest_QuOtEd" cascade;
drop table if exists migtest_e_ref cascade;
drop sequence if exists migtest_e_ref_seq;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.3.sql
index 510820e7b..8397edb71 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/1.3.sql
@@ -17,6 +17,16 @@ alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_stat
drop index if exists ix_migtest_e_basic_indextest3;
drop index if exists ix_migtest_e_basic_indextest6;
-- apply changes
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -71,3 +81,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/idx_cockroach.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/idx_cockroach.migrations
index 69de34b1f..71060fe76 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/idx_cockroach.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/cockroach/idx_cockroach.migrations
@@ -1,7 +1,7 @@
-1636200128, 1.0__initial.sql
-356413151, 1.1.sql
-240919209, 1.2__dropsFor_1.1.sql
--430000356, 1.3.sql
+-703764770, 1.0__initial.sql
+751308758, 1.1.sql
+856096334, 1.2__dropsFor_1.1.sql
+17665322, 1.3.sql
-820814009, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.0__initial.sql
index 20ebe89e7..98315d5d8 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.0__initial.sql
@@ -125,6 +125,15 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -209,6 +218,7 @@ create table migtest_e_history5_history as (select * from migtest_e_history5) wi
alter table migtest_e_history5 add versioning use history table migtest_e_history5_history;
create table migtest_e_history6_history as (select * from migtest_e_history6) with no data;
alter table migtest_e_history6 add versioning use history table migtest_e_history6_history;
+create unique index uq_migtest_quoted_status2 on "migtest_QuOtEd"(status2) exclude null keys;
alter table migtest_e_ref add constraint uq_migtest_e_ref_name unique (name);
create unique index uq_table_to on "table"("to") exclude null keys;
create unique index uq_table_varchar on "table"("varchar") exclude null keys;
@@ -229,4 +239,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index ix_table_from on "table" ("from");
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.1.sql
index 9ed658aca..3173b15a1 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.1.sql
@@ -2,81 +2,88 @@
-- drop dependencies
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and tabname = 'MIGTEST_FK_CASCADE') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_CASCADE') then
prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and tabname = 'MIGTEST_FK_SET_NULL') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_SET_NULL') then
prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS2' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST2' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest2';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST2') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST2') then
prepare stmt from 'drop index uq_migtest_e_basic_indextest2';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST6' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST6' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST6') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST6') then
prepare stmt from 'drop index uq_migtest_e_basic_indextest6';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and tabname = 'MIGTEST_E_ENUM') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and ucase(tabname) = 'MIGTEST_E_ENUM') then
prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then
prepare stmt from 'drop index ix_migtest_e_basic_indextest1';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST5') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST5') then
prepare stmt from 'drop index ix_migtest_e_basic_indextest5';
execute stmt;
end if;
end$$;
+delimiter $$
+begin
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_QUOTED_STATUS1') then
+ prepare stmt from 'drop index ix_migtest_quoted_status1';
+ execute stmt;
+end if;
+end$$;
-- apply changes
create table migtest_e_user (
id integer generated by default as identity not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.2__dropsFor_1.1.sql
index 7f78aa9b3..28b8850d6 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.2__dropsFor_1.1.sql
@@ -15,10 +15,11 @@ alter table migtest_e_history2_history drop column obsolete_string2;
call sysproc.admin_cmd('reorg table migtest_e_history2_history');
-- apply post alter
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
+drop table "migtest_QuOtEd";
drop table migtest_e_ref;
delimiter $$
begin
-if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = 'MIGTEST_E_REF_SEQ') then
+if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_REF_SEQ') then
prepare stmt from 'drop sequence migtest_e_ref_seq';
execute stmt;
end if;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.3.sql
index 545ccdeb4..67dc90eff 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.3.sql
@@ -2,152 +2,161 @@
-- drop dependencies
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_CKEY_DETAIL_PARENT' and tabname = 'MIGTEST_CKEY_DETAIL') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_CKEY_DETAIL_PARENT' and ucase(tabname) = 'MIGTEST_CKEY_DETAIL') then
prepare stmt from 'alter table migtest_ckey_detail drop constraint fk_migtest_ckey_detail_parent';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and tabname = 'MIGTEST_FK_CASCADE') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_CASCADE') then
prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_NONE_ONE_ID' and tabname = 'MIGTEST_FK_NONE') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_NONE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_NONE') then
prepare stmt from 'alter table migtest_fk_none drop constraint fk_migtest_fk_none_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_NONE_VIA_JOIN_ONE_ID' and tabname = 'MIGTEST_FK_NONE_VIA_JOIN') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_NONE_VIA_JOIN_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_NONE_VIA_JOIN') then
prepare stmt from 'alter table migtest_fk_none_via_join drop constraint fk_migtest_fk_none_via_join_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and tabname = 'MIGTEST_FK_SET_NULL') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_SET_NULL') then
prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS2' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_DESCRIPTION' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_DESCRIPTION' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_description';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_DESCRIPTION') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_DESCRIPTION') then
prepare stmt from 'drop index uq_migtest_e_basic_description';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_E_BASIC_USER_ID' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_E_BASIC_USER_ID' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint fk_migtest_e_basic_user_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_status_indextest1';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1') then
prepare stmt from 'drop index uq_migtest_e_basic_status_indextest1';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_NAME' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_NAME' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_name';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_NAME') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_NAME') then
prepare stmt from 'drop index uq_migtest_e_basic_name';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST4' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST4' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST4') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST4') then
prepare stmt from 'drop index uq_migtest_e_basic_indextest4';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST5' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST5' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST5') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST5') then
prepare stmt from 'drop index uq_migtest_e_basic_indextest5';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and tabname = 'MIGTEST_E_ENUM') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and ucase(tabname) = 'MIGTEST_E_ENUM') then
prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST3') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST3') then
prepare stmt from 'drop index ix_migtest_e_basic_indextest3';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST6') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST6') then
prepare stmt from 'drop index ix_migtest_e_basic_indextest6';
execute stmt;
end if;
end$$;
-- apply changes
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -207,6 +216,7 @@ alter table migtest_e_history6_history alter column test_number1 drop not null;
alter table migtest_e_history6_history alter column test_number2 set not null;
call sysproc.admin_cmd('reorg table migtest_e_history6_history');
-- apply post alter
+create unique index uq_migtest_quoted_status2 on "migtest_QuOtEd"(status2) exclude null keys;
alter table migtest_e_ref add constraint uq_migtest_e_ref_name unique (name);
alter table migtest_e_basic add constraint ck_migtest_e_basic_status check ( status in ('N','A','I'));
alter table migtest_e_basic add constraint ck_migtest_e_basic_status2 check ( status2 in ('N','A','I'));
@@ -228,3 +238,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.4__dropsFor_1.3.sql
index 5542a954f..95bd2ed00 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.4__dropsFor_1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2fori/1.4__dropsFor_1.3.sql
@@ -43,7 +43,7 @@ alter table migtest_e_history5 add versioning use history table migtest_e_histor
drop table migtest_e_user;
delimiter $$
begin
-if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = 'MIGTEST_E_USER_SEQ') then
+if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_USER_SEQ') then
prepare stmt from 'drop sequence migtest_e_user_seq';
execute stmt;
end if;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.0__initial.sql
index fc3c2054e..add87042b 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.0__initial.sql
@@ -125,6 +125,15 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_mgtst_qtd_stts1 check ( status1 in ('N','A','I')),
+ constraint ck_mgtst_qtd_stts2 check ( status2 in ('N','A','I')),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -209,6 +218,7 @@ create table migtest_e_history5_history as (select * from migtest_e_history5) wi
alter table migtest_e_history5 add versioning use history table migtest_e_history5_history;
create table migtest_e_history6_history as (select * from migtest_e_history6) with no data;
alter table migtest_e_history6 add versioning use history table migtest_e_history6_history;
+create unique index uq_mgtst_qtd_stts2 on "migtest_QuOtEd"(status2) exclude null keys;
alter table migtest_e_ref add constraint uq_mgtst__rf_nm unique (name);
create unique index uq_table_to on "table"("to") exclude null keys;
create unique index uq_table_varchar on "table"("varchar") exclude null keys;
@@ -229,4 +239,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
create index ix_mgtst__b_eu8csq on migtest_e_basic (indextest1);
create index ix_mgtst__b_eu8csu on migtest_e_basic (indextest5);
+create index ix_mgtst_qtd_stts1 on "migtest_QuOtEd" (status1);
create index ix_table_from on "table" ("from");
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.1.sql
index 82051c0b1..3a55740be 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.1.sql
@@ -2,81 +2,88 @@
-- drop dependencies
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MGTST_FK_65KF6L' and tabname = 'MIGTEST_FK_CASCADE') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MGTST_FK_65KF6L' and ucase(tabname) = 'MIGTEST_FK_CASCADE') then
prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_mgtst_fk_65kf6l';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MGTST_FK_WICX8X' and tabname = 'MIGTEST_FK_SET_NULL') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MGTST_FK_WICX8X' and ucase(tabname) = 'MIGTEST_FK_SET_NULL') then
prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_mgtst_fk_wicx8x';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MGTST__BSC_STTS' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MGTST__BSC_STTS' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint ck_mgtst__bsc_stts';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MGTST__B_Z543FG' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MGTST__B_Z543FG' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint ck_mgtst__b_z543fg';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MGTST__B_4AYBZY' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MGTST__B_4AYBZY' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_4aybzy';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MGTST__B_4AYBZY') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MGTST__B_4AYBZY') then
prepare stmt from 'drop index uq_mgtst__b_4aybzy';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MGTST__B_4AYC02' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MGTST__B_4AYC02' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_4ayc02';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MGTST__B_4AYC02') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MGTST__B_4AYC02') then
prepare stmt from 'drop index uq_mgtst__b_4ayc02';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MGTST__N_773SOK' and tabname = 'MIGTEST_E_ENUM') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MGTST__N_773SOK' and ucase(tabname) = 'MIGTEST_E_ENUM') then
prepare stmt from 'alter table migtest_e_enum drop constraint ck_mgtst__n_773sok';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MGTST__B_EU8CSQ') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MGTST__B_EU8CSQ') then
prepare stmt from 'drop index ix_mgtst__b_eu8csq';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MGTST__B_EU8CSU') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MGTST__B_EU8CSU') then
prepare stmt from 'drop index ix_mgtst__b_eu8csu';
execute stmt;
end if;
end$$;
+delimiter $$
+begin
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MGTST_QTD_STTS1') then
+ prepare stmt from 'drop index ix_mgtst_qtd_stts1';
+ execute stmt;
+end if;
+end$$;
-- apply changes
create table migtest_e_user (
id integer generated by default as identity not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.2__dropsFor_1.1.sql
index 7f78aa9b3..28b8850d6 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.2__dropsFor_1.1.sql
@@ -15,10 +15,11 @@ alter table migtest_e_history2_history drop column obsolete_string2;
call sysproc.admin_cmd('reorg table migtest_e_history2_history');
-- apply post alter
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
+drop table "migtest_QuOtEd";
drop table migtest_e_ref;
delimiter $$
begin
-if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = 'MIGTEST_E_REF_SEQ') then
+if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_REF_SEQ') then
prepare stmt from 'drop sequence migtest_e_ref_seq';
execute stmt;
end if;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.3.sql
index cdd739792..f388af01d 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.3.sql
@@ -2,152 +2,161 @@
-- drop dependencies
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MGTST_CK_E1QKB5' and tabname = 'MIGTEST_CKEY_DETAIL') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MGTST_CK_E1QKB5' and ucase(tabname) = 'MIGTEST_CKEY_DETAIL') then
prepare stmt from 'alter table migtest_ckey_detail drop constraint fk_mgtst_ck_e1qkb5';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MGTST_FK_65KF6L' and tabname = 'MIGTEST_FK_CASCADE') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MGTST_FK_65KF6L' and ucase(tabname) = 'MIGTEST_FK_CASCADE') then
prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_mgtst_fk_65kf6l';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MGTST_FK_NN_N_D' and tabname = 'MIGTEST_FK_NONE') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MGTST_FK_NN_N_D' and ucase(tabname) = 'MIGTEST_FK_NONE') then
prepare stmt from 'alter table migtest_fk_none drop constraint fk_mgtst_fk_nn_n_d';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MGTST_FK_9TKNZJ' and tabname = 'MIGTEST_FK_NONE_VIA_JOIN') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MGTST_FK_9TKNZJ' and ucase(tabname) = 'MIGTEST_FK_NONE_VIA_JOIN') then
prepare stmt from 'alter table migtest_fk_none_via_join drop constraint fk_mgtst_fk_9tknzj';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MGTST_FK_WICX8X' and tabname = 'MIGTEST_FK_SET_NULL') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MGTST_FK_WICX8X' and ucase(tabname) = 'MIGTEST_FK_SET_NULL') then
prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_mgtst_fk_wicx8x';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MGTST__BSC_STTS' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MGTST__BSC_STTS' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint ck_mgtst__bsc_stts';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MGTST__B_Z543FG' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MGTST__B_Z543FG' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint ck_mgtst__b_z543fg';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MGTST__B_VS45XO' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MGTST__B_VS45XO' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_vs45xo';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MGTST__B_VS45XO') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MGTST__B_VS45XO') then
prepare stmt from 'drop index uq_mgtst__b_vs45xo';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MGTST__BSC_SR_D' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MGTST__BSC_SR_D' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint fk_mgtst__bsc_sr_d';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MGTST__B_UCFCNE' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MGTST__B_UCFCNE' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_ucfcne';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MGTST__B_UCFCNE') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MGTST__B_UCFCNE') then
prepare stmt from 'drop index uq_mgtst__b_ucfcne';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MGTST__BSC_NM' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MGTST__BSC_NM' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__bsc_nm';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MGTST__BSC_NM') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MGTST__BSC_NM') then
prepare stmt from 'drop index uq_mgtst__bsc_nm';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MGTST__B_4AYC00' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MGTST__B_4AYC00' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_4ayc00';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MGTST__B_4AYC00') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MGTST__B_4AYC00') then
prepare stmt from 'drop index uq_mgtst__b_4ayc00';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MGTST__B_4AYC01' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MGTST__B_4AYC01' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_4ayc01';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MGTST__B_4AYC01') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MGTST__B_4AYC01') then
prepare stmt from 'drop index uq_mgtst__b_4ayc01';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MGTST__N_773SOK' and tabname = 'MIGTEST_E_ENUM') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MGTST__N_773SOK' and ucase(tabname) = 'MIGTEST_E_ENUM') then
prepare stmt from 'alter table migtest_e_enum drop constraint ck_mgtst__n_773sok';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MGTST__B_EU8CSS') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MGTST__B_EU8CSS') then
prepare stmt from 'drop index ix_mgtst__b_eu8css';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MGTST__B_EU8CSV') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MGTST__B_EU8CSV') then
prepare stmt from 'drop index ix_mgtst__b_eu8csv';
execute stmt;
end if;
end$$;
-- apply changes
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_mgtst_qtd_stts1 check ( status1 in ('N','A','I')),
+ constraint ck_mgtst_qtd_stts2 check ( status2 in ('N','A','I')),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -207,6 +216,7 @@ alter table migtest_e_history6_history alter column test_number1 drop not null;
alter table migtest_e_history6_history alter column test_number2 set not null;
call sysproc.admin_cmd('reorg table migtest_e_history6_history');
-- apply post alter
+create unique index uq_mgtst_qtd_stts2 on "migtest_QuOtEd"(status2) exclude null keys;
alter table migtest_e_ref add constraint uq_mgtst__rf_nm unique (name);
alter table migtest_e_basic add constraint ck_mgtst__bsc_stts check ( status in ('N','A','I'));
alter table migtest_e_basic add constraint ck_mgtst__b_z543fg check ( status2 in ('N','A','I'));
@@ -228,3 +238,4 @@ alter table migtest_e_basic add constraint fk_mgtst__bsc_rf_d foreign key (eref_
create index ix_mgtst__b_eu8csq on migtest_e_basic (indextest1);
create index ix_mgtst__b_eu8csu on migtest_e_basic (indextest5);
+create index ix_mgtst_qtd_stts1 on "migtest_QuOtEd" (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.4__dropsFor_1.3.sql
index 5542a954f..95bd2ed00 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.4__dropsFor_1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2legacy/1.4__dropsFor_1.3.sql
@@ -43,7 +43,7 @@ alter table migtest_e_history5 add versioning use history table migtest_e_histor
drop table migtest_e_user;
delimiter $$
begin
-if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = 'MIGTEST_E_USER_SEQ') then
+if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_USER_SEQ') then
prepare stmt from 'drop sequence migtest_e_user_seq';
execute stmt;
end if;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.0__initial.sql
index 8a9d1adeb..7bd62bcb0 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.0__initial.sql
@@ -125,6 +125,15 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -209,6 +218,7 @@ create table migtest_e_history5_history as (select * from migtest_e_history5) wi
alter table migtest_e_history5 add versioning use history table migtest_e_history5_history;
create table migtest_e_history6_history as (select * from migtest_e_history6) with no data;
alter table migtest_e_history6 add versioning use history table migtest_e_history6_history;
+create unique index uq_migtest_quoted_status2 on "migtest_QuOtEd"(status2) exclude null keys;
alter table migtest_e_ref add constraint uq_migtest_e_ref_name unique (name);
create unique index uq_table_to on "table"("to") exclude null keys;
create unique index uq_table_varchar on "table"("varchar") exclude null keys;
@@ -229,4 +239,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index ix_table_from on "table" ("from");
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.1.sql
index a5d6e0287..59a21614c 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.1.sql
@@ -2,81 +2,88 @@
-- drop dependencies
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and tabname = 'MIGTEST_FK_CASCADE') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_CASCADE') then
prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and tabname = 'MIGTEST_FK_SET_NULL') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_SET_NULL') then
prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS2' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST2' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest2';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST2') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST2') then
prepare stmt from 'drop index uq_migtest_e_basic_indextest2';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST6' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST6' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST6') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST6') then
prepare stmt from 'drop index uq_migtest_e_basic_indextest6';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and tabname = 'MIGTEST_E_ENUM') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and ucase(tabname) = 'MIGTEST_E_ENUM') then
prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then
prepare stmt from 'drop index ix_migtest_e_basic_indextest1';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST5') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST5') then
prepare stmt from 'drop index ix_migtest_e_basic_indextest5';
execute stmt;
end if;
end$$;
+delimiter $$
+begin
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_QUOTED_STATUS1') then
+ prepare stmt from 'drop index ix_migtest_quoted_status1';
+ execute stmt;
+end if;
+end$$;
-- apply changes
create table migtest_e_user (
id integer generated by default as identity not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.2__dropsFor_1.1.sql
index 7f78aa9b3..28b8850d6 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.2__dropsFor_1.1.sql
@@ -15,10 +15,11 @@ alter table migtest_e_history2_history drop column obsolete_string2;
call sysproc.admin_cmd('reorg table migtest_e_history2_history');
-- apply post alter
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
+drop table "migtest_QuOtEd";
drop table migtest_e_ref;
delimiter $$
begin
-if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = 'MIGTEST_E_REF_SEQ') then
+if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_REF_SEQ') then
prepare stmt from 'drop sequence migtest_e_ref_seq';
execute stmt;
end if;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.3.sql
index b5d82e860..f61a3c695 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.3.sql
@@ -2,152 +2,161 @@
-- drop dependencies
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_CKEY_DETAIL_PARENT' and tabname = 'MIGTEST_CKEY_DETAIL') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_CKEY_DETAIL_PARENT' and ucase(tabname) = 'MIGTEST_CKEY_DETAIL') then
prepare stmt from 'alter table migtest_ckey_detail drop constraint fk_migtest_ckey_detail_parent';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and tabname = 'MIGTEST_FK_CASCADE') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_CASCADE') then
prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_NONE_ONE_ID' and tabname = 'MIGTEST_FK_NONE') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_NONE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_NONE') then
prepare stmt from 'alter table migtest_fk_none drop constraint fk_migtest_fk_none_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_NONE_VIA_JOIN_ONE_ID' and tabname = 'MIGTEST_FK_NONE_VIA_JOIN') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_NONE_VIA_JOIN_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_NONE_VIA_JOIN') then
prepare stmt from 'alter table migtest_fk_none_via_join drop constraint fk_migtest_fk_none_via_join_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and tabname = 'MIGTEST_FK_SET_NULL') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_SET_NULL') then
prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS2' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_DESCRIPTION' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_DESCRIPTION' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_description';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_DESCRIPTION') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_DESCRIPTION') then
prepare stmt from 'drop index uq_migtest_e_basic_description';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_E_BASIC_USER_ID' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_E_BASIC_USER_ID' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint fk_migtest_e_basic_user_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_status_indextest1';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1') then
prepare stmt from 'drop index uq_migtest_e_basic_status_indextest1';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_NAME' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_NAME' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_name';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_NAME') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_NAME') then
prepare stmt from 'drop index uq_migtest_e_basic_name';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST4' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST4' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST4') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST4') then
prepare stmt from 'drop index uq_migtest_e_basic_indextest4';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST5' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST5' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST5') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST5') then
prepare stmt from 'drop index uq_migtest_e_basic_indextest5';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and tabname = 'MIGTEST_E_ENUM') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and ucase(tabname) = 'MIGTEST_E_ENUM') then
prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST3') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST3') then
prepare stmt from 'drop index ix_migtest_e_basic_indextest3';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST6') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST6') then
prepare stmt from 'drop index ix_migtest_e_basic_indextest6';
execute stmt;
end if;
end$$;
-- apply changes
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -207,6 +216,7 @@ alter table migtest_e_history6_history alter column test_number1 drop not null;
alter table migtest_e_history6_history alter column test_number2 set not null;
call sysproc.admin_cmd('reorg table migtest_e_history6_history');
-- apply post alter
+create unique index uq_migtest_quoted_status2 on "migtest_QuOtEd"(status2) exclude null keys;
alter table migtest_e_ref add constraint uq_migtest_e_ref_name unique (name);
alter table migtest_e_basic add constraint ck_migtest_e_basic_status check ( status in ('N','A','I'));
alter table migtest_e_basic add constraint ck_migtest_e_basic_status2 check ( status2 in ('N','A','I'));
@@ -228,3 +238,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.4__dropsFor_1.3.sql
index 5542a954f..95bd2ed00 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.4__dropsFor_1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2luw/1.4__dropsFor_1.3.sql
@@ -43,7 +43,7 @@ alter table migtest_e_history5 add versioning use history table migtest_e_histor
drop table migtest_e_user;
delimiter $$
begin
-if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = 'MIGTEST_E_USER_SEQ') then
+if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_USER_SEQ') then
prepare stmt from 'drop sequence migtest_e_user_seq';
execute stmt;
end if;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.0__initial.sql
index 8a9d1adeb..7bd62bcb0 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.0__initial.sql
@@ -125,6 +125,15 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -209,6 +218,7 @@ create table migtest_e_history5_history as (select * from migtest_e_history5) wi
alter table migtest_e_history5 add versioning use history table migtest_e_history5_history;
create table migtest_e_history6_history as (select * from migtest_e_history6) with no data;
alter table migtest_e_history6 add versioning use history table migtest_e_history6_history;
+create unique index uq_migtest_quoted_status2 on "migtest_QuOtEd"(status2) exclude null keys;
alter table migtest_e_ref add constraint uq_migtest_e_ref_name unique (name);
create unique index uq_table_to on "table"("to") exclude null keys;
create unique index uq_table_varchar on "table"("varchar") exclude null keys;
@@ -229,4 +239,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index ix_table_from on "table" ("from");
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.1.sql
index a5d6e0287..59a21614c 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.1.sql
@@ -2,81 +2,88 @@
-- drop dependencies
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and tabname = 'MIGTEST_FK_CASCADE') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_CASCADE') then
prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and tabname = 'MIGTEST_FK_SET_NULL') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_SET_NULL') then
prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS2' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST2' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest2';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST2') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST2') then
prepare stmt from 'drop index uq_migtest_e_basic_indextest2';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST6' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST6' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST6') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST6') then
prepare stmt from 'drop index uq_migtest_e_basic_indextest6';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and tabname = 'MIGTEST_E_ENUM') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and ucase(tabname) = 'MIGTEST_E_ENUM') then
prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then
prepare stmt from 'drop index ix_migtest_e_basic_indextest1';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST5') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST5') then
prepare stmt from 'drop index ix_migtest_e_basic_indextest5';
execute stmt;
end if;
end$$;
+delimiter $$
+begin
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_QUOTED_STATUS1') then
+ prepare stmt from 'drop index ix_migtest_quoted_status1';
+ execute stmt;
+end if;
+end$$;
-- apply changes
create table migtest_e_user (
id integer generated by default as identity not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.2__dropsFor_1.1.sql
index 7f78aa9b3..28b8850d6 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.2__dropsFor_1.1.sql
@@ -15,10 +15,11 @@ alter table migtest_e_history2_history drop column obsolete_string2;
call sysproc.admin_cmd('reorg table migtest_e_history2_history');
-- apply post alter
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
+drop table "migtest_QuOtEd";
drop table migtest_e_ref;
delimiter $$
begin
-if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = 'MIGTEST_E_REF_SEQ') then
+if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_REF_SEQ') then
prepare stmt from 'drop sequence migtest_e_ref_seq';
execute stmt;
end if;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.3.sql
index b5d82e860..f61a3c695 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.3.sql
@@ -2,152 +2,161 @@
-- drop dependencies
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_CKEY_DETAIL_PARENT' and tabname = 'MIGTEST_CKEY_DETAIL') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_CKEY_DETAIL_PARENT' and ucase(tabname) = 'MIGTEST_CKEY_DETAIL') then
prepare stmt from 'alter table migtest_ckey_detail drop constraint fk_migtest_ckey_detail_parent';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and tabname = 'MIGTEST_FK_CASCADE') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_CASCADE') then
prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_NONE_ONE_ID' and tabname = 'MIGTEST_FK_NONE') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_NONE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_NONE') then
prepare stmt from 'alter table migtest_fk_none drop constraint fk_migtest_fk_none_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_NONE_VIA_JOIN_ONE_ID' and tabname = 'MIGTEST_FK_NONE_VIA_JOIN') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_NONE_VIA_JOIN_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_NONE_VIA_JOIN') then
prepare stmt from 'alter table migtest_fk_none_via_join drop constraint fk_migtest_fk_none_via_join_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and tabname = 'MIGTEST_FK_SET_NULL') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_SET_NULL') then
prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS2' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_DESCRIPTION' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_DESCRIPTION' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_description';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_DESCRIPTION') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_DESCRIPTION') then
prepare stmt from 'drop index uq_migtest_e_basic_description';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_E_BASIC_USER_ID' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_E_BASIC_USER_ID' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint fk_migtest_e_basic_user_id';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_status_indextest1';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1') then
prepare stmt from 'drop index uq_migtest_e_basic_status_indextest1';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_NAME' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_NAME' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_name';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_NAME') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_NAME') then
prepare stmt from 'drop index uq_migtest_e_basic_name';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST4' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST4' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST4') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST4') then
prepare stmt from 'drop index uq_migtest_e_basic_indextest4';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST5' and tabname = 'MIGTEST_E_BASIC') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST5' and ucase(tabname) = 'MIGTEST_E_BASIC') then
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5';
execute stmt;
end if;
end$$
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST5') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST5') then
prepare stmt from 'drop index uq_migtest_e_basic_indextest5';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and tabname = 'MIGTEST_E_ENUM') then
+if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and ucase(tabname) = 'MIGTEST_E_ENUM') then
prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST3') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST3') then
prepare stmt from 'drop index ix_migtest_e_basic_indextest3';
execute stmt;
end if;
end$$;
delimiter $$
begin
-if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST6') then
+if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST6') then
prepare stmt from 'drop index ix_migtest_e_basic_indextest6';
execute stmt;
end if;
end$$;
-- apply changes
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -207,6 +216,7 @@ alter table migtest_e_history6_history alter column test_number1 drop not null;
alter table migtest_e_history6_history alter column test_number2 set not null;
call sysproc.admin_cmd('reorg table migtest_e_history6_history');
-- apply post alter
+create unique index uq_migtest_quoted_status2 on "migtest_QuOtEd"(status2) exclude null keys;
alter table migtest_e_ref add constraint uq_migtest_e_ref_name unique (name);
alter table migtest_e_basic add constraint ck_migtest_e_basic_status check ( status in ('N','A','I'));
alter table migtest_e_basic add constraint ck_migtest_e_basic_status2 check ( status2 in ('N','A','I'));
@@ -228,3 +238,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.4__dropsFor_1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.4__dropsFor_1.3.sql
index 5542a954f..95bd2ed00 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.4__dropsFor_1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/db2zos/1.4__dropsFor_1.3.sql
@@ -43,7 +43,7 @@ alter table migtest_e_history5 add versioning use history table migtest_e_histor
drop table migtest_e_user;
delimiter $$
begin
-if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = 'MIGTEST_E_USER_SEQ') then
+if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_USER_SEQ') then
prepare stmt from 'drop sequence migtest_e_user_seq';
execute stmt;
end if;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.0__initial.sql
index 0ac3d868a..4deaeeaa5 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.0__initial.sql
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer auto_increment not null,
name varchar(127) not null,
@@ -191,4 +201,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index ix_table_from on "table" ("from");
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.1.sql
index dc9bed0c0..10c455972 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.1.sql
@@ -9,6 +9,7 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6;
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
drop index if exists ix_migtest_e_basic_indextest1;
drop index if exists ix_migtest_e_basic_indextest5;
+drop index if exists ix_migtest_quoted_status1;
-- apply changes
create table migtest_e_user (
id integer auto_increment not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.2__dropsFor_1.1.sql
index 4ec79a34c..cb6860e63 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.2__dropsFor_1.1.sql
@@ -7,4 +7,5 @@ alter table migtest_e_basic drop column eref_id;
alter table migtest_e_history2 drop column obsolete_string1;
alter table migtest_e_history2 drop column obsolete_string2;
-- apply post alter
+drop table if exists "migtest_QuOtEd";
drop table if exists migtest_e_ref;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.3.sql
index ec207d6a4..ac80b64d5 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/1.3.sql
@@ -17,6 +17,16 @@ alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_stat
drop index if exists ix_migtest_e_basic_indextest3;
drop index if exists ix_migtest_e_basic_indextest6;
-- apply changes
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer auto_increment not null,
name varchar(127) not null,
@@ -74,3 +84,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/idx_generic.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/idx_generic.migrations
index a6df69810..8dfa501f7 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/generic/idx_generic.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/generic/idx_generic.migrations
@@ -1,6 +1,6 @@
--1347475412, 1.0__initial.sql
-2132717520, 1.1.sql
-1279151426, 1.2__dropsFor_1.1.sql
--796269364, 1.3.sql
+-710189690, 1.0__initial.sql
+1626063176, 1.1.sql
+688811494, 1.2__dropsFor_1.1.sql
+2025934113, 1.3.sql
80209848, 1.4__dropsFor_1.3.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.0__initial.sql
index e3b222262..508177c05 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.0__initial.sql
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -265,4 +275,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index ix_table_from on "table" ("from");
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.1.sql
index f34c6996f..0936da80e 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.1.sql
@@ -9,6 +9,7 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6;
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
drop index if exists ix_migtest_e_basic_indextest1;
drop index if exists ix_migtest_e_basic_indextest5;
+drop index if exists ix_migtest_quoted_status1;
-- apply changes
create table migtest_e_user (
id integer generated by default as identity not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.2__dropsFor_1.1.sql
index f3112c454..1037b7b67 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.2__dropsFor_1.1.sql
@@ -14,5 +14,6 @@ alter table migtest_e_history2_history drop column obsolete_string2;
-- apply post alter
create view migtest_e_history2_with_history as select * from migtest_e_history2 union all select * from migtest_e_history2_history;
create trigger migtest_e_history2_history_upd before update,delete on migtest_e_history2 for each row call "io.ebean.config.dbplatform.h2.H2HistoryTrigger";
+drop table if exists "migtest_QuOtEd";
drop table if exists migtest_e_ref;
drop sequence if exists migtest_e_ref_seq;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.3.sql
index 80d4f9aa0..9ec4e5674 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/1.3.sql
@@ -17,6 +17,16 @@ alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_stat
drop index if exists ix_migtest_e_basic_indextest3;
drop index if exists ix_migtest_e_basic_indextest6;
-- apply changes
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -95,3 +105,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/idx_h2.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/idx_h2.migrations
index 7a87fc386..f32ee0de6 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/h2/idx_h2.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/h2/idx_h2.migrations
@@ -1,7 +1,7 @@
--1179806373, 1.0__initial.sql
-398205555, 1.1.sql
--1366392410, 1.2__dropsFor_1.1.sql
--523874424, 1.3.sql
+-1826073043, 1.0__initial.sql
+-132538485, 1.1.sql
+-2064267391, 1.2__dropsFor_1.1.sql
+-94686510, 1.3.sql
-1382108238, 1.4__dropsFor_1.3.sql
783227075, R__multi_comments.sql
561281075, R__order_views.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.0__initial.sql
index c0df03053..a6b08b371 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.0__initial.sql
@@ -127,6 +127,16 @@ create column table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create column table "migtest_QuOtEd" (
+ id nvarchar(255) not null,
+ status1 nvarchar(1),
+ status2 nvarchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create column table migtest_e_ref (
id integer generated by default as identity not null,
name nvarchar(127) not null,
@@ -271,4 +281,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
-- explicit index "ix_migtest_e_basic_indextest1" for single column "indextest1" of table "migtest_e_basic" is not necessary;
-- explicit index "ix_migtest_e_basic_indextest5" for single column "indextest5" of table "migtest_e_basic" is not necessary;
+-- explicit index "ix_migtest_quoted_status1" for single column "status1" of table ""migtest_QuOtEd"" is not necessary;
-- explicit index "ix_table_from" for single column ""from"" of table ""table"" is not necessary;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.1.sql
index 8de138abb..c6c66676f 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.1.sql
@@ -51,6 +51,13 @@ declare exit handler for sql_error_code 261 begin end;
exec 'drop index ix_migtest_e_basic_indextest5';
end;
$$;
+delimiter $$
+do
+begin
+declare exit handler for sql_error_code 261 begin end;
+exec 'drop index ix_migtest_quoted_status1';
+end;
+$$;
-- apply changes
create column table migtest_e_user (
id integer generated by default as identity not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.2__dropsFor_1.1.sql
index 14a60d921..b5fe0f04f 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.2__dropsFor_1.1.sql
@@ -12,4 +12,5 @@ CALL usp_ebean_drop_column('migtest_e_history2_history', 'obsolete_string1');
CALL usp_ebean_drop_column('migtest_e_history2_history', 'obsolete_string2');
-- apply post alter
alter table migtest_e_history2 add system versioning history table migtest_e_history2_history not validated;
+drop table "migtest_QuOtEd" cascade;
drop table migtest_e_ref cascade;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.3.sql
index b44e90abe..228ebaa58 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/1.3.sql
@@ -77,6 +77,16 @@ exec 'drop index ix_migtest_e_basic_indextest6';
end;
$$;
-- apply changes
+create column table "migtest_QuOtEd" (
+ id nvarchar(255) not null,
+ status1 nvarchar(1),
+ status2 nvarchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create column table migtest_e_ref (
id integer generated by default as identity not null,
name nvarchar(127) not null,
@@ -141,3 +151,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
-- explicit index "ix_migtest_e_basic_indextest1" for single column "indextest1" of table "migtest_e_basic" is not necessary;
-- explicit index "ix_migtest_e_basic_indextest5" for single column "indextest5" of table "migtest_e_basic" is not necessary;
+-- explicit index "ix_migtest_quoted_status1" for single column "status1" of table ""migtest_QuOtEd"" is not necessary;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/idx_hana.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/idx_hana.migrations
index b88d4fd3d..d08cf01f1 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/hana/idx_hana.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hana/idx_hana.migrations
@@ -1,8 +1,8 @@
-745347271, I__create_procs.sql
-1934891896, 1.0__initial.sql
-187688059, 1.1.sql
-197547825, 1.2__dropsFor_1.1.sql
--1989736027, 1.3.sql
+1631114894, 1.0__initial.sql
+-1483493637, 1.1.sql
+1535221752, 1.2__dropsFor_1.1.sql
+483907844, 1.3.sql
1812245353, 1.4__dropsFor_1.3.sql
1906063401, R__order_views_hana.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.0__initial.sql
index 47015f010..f84501c10 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.0__initial.sql
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity (start with 1) not null,
name varchar(127) not null,
@@ -191,4 +201,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index ix_table_from on "table" ("from");
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.1.sql
index 04d1379e5..f3e9c0192 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.1.sql
@@ -9,6 +9,7 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6;
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
drop index if exists ix_migtest_e_basic_indextest1;
drop index if exists ix_migtest_e_basic_indextest5;
+drop index if exists ix_migtest_quoted_status1;
-- apply changes
create table migtest_e_user (
id integer generated by default as identity (start with 1) not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.2__dropsFor_1.1.sql
index f33b6874f..eeb8a6a1c 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.2__dropsFor_1.1.sql
@@ -7,5 +7,6 @@ alter table migtest_e_basic drop column eref_id;
alter table migtest_e_history2 drop column obsolete_string1;
alter table migtest_e_history2 drop column obsolete_string2;
-- apply post alter
+drop table if exists "migtest_QuOtEd";
drop table if exists migtest_e_ref;
drop sequence if exists migtest_e_ref_seq;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.3.sql
index 4658ed476..de92cd16f 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/1.3.sql
@@ -17,6 +17,16 @@ alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_stat
drop index if exists ix_migtest_e_basic_indextest3;
drop index if exists ix_migtest_e_basic_indextest6;
-- apply changes
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity (start with 1) not null,
name varchar(127) not null,
@@ -74,3 +84,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/idx_hsqldb.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/idx_hsqldb.migrations
index 8cd03776b..4e2942e64 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/idx_hsqldb.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/hsqldb/idx_hsqldb.migrations
@@ -1,7 +1,7 @@
--917796012, 1.0__initial.sql
--838725141, 1.1.sql
--300925212, 1.2__dropsFor_1.1.sql
--1549893170, 1.3.sql
+-906026927, 1.0__initial.sql
+135699844, 1.1.sql
+-848622216, 1.2__dropsFor_1.1.sql
+781720387, 1.3.sql
-972999284, 1.4__dropsFor_1.3.sql
861001272, R__order_views_hsqldb.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.0__initial.sql
index 871dfe2de..be0dfa028 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.0__initial.sql
@@ -124,6 +124,14 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table `migtest_QuOtEd` (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer auto_increment not null,
name varchar(127) not null,
@@ -194,4 +202,5 @@ alter table `table` add constraint fk_table_foreign foreign key (`foreign`) refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
create index ix_table_from on `table` (`from`);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.1.sql
index a47607fa6..85849f0ff 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.1.sql
@@ -6,6 +6,7 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_indextest2;
alter table migtest_e_basic drop index uq_migtest_e_basic_indextest6;
drop index ix_migtest_e_basic_indextest1 on migtest_e_basic;
drop index ix_migtest_e_basic_indextest5 on migtest_e_basic;
+drop index ix_migtest_quoted_status1 on `migtest_QuOtEd`;
-- apply changes
create table migtest_e_user (
id integer auto_increment not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.2__dropsFor_1.1.sql
index 52ed4e9c0..60699805e 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.2__dropsFor_1.1.sql
@@ -9,5 +9,6 @@ alter table migtest_e_basic drop column eref_id;
alter table migtest_e_history2 drop column obsolete_string1;
alter table migtest_e_history2 drop column obsolete_string2;
-- apply post alter
+drop table if exists `migtest_QuOtEd`;
drop table if exists migtest_e_ref;
drop sequence if exists migtest_e_ref_seq;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.3.sql
index f0c10c5ed..fc633abc6 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/1.3.sql
@@ -14,6 +14,14 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_indextest5;
drop index ix_migtest_e_basic_indextest3 on migtest_e_basic;
drop index ix_migtest_e_basic_indextest6 on migtest_e_basic;
-- apply changes
+create table `migtest_QuOtEd` (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer auto_increment not null,
name varchar(127) not null,
@@ -58,3 +66,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/idx_mariadb.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/idx_mariadb.migrations
index f94e6b123..c49cd375a 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/idx_mariadb.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb-noprocs/idx_mariadb.migrations
@@ -1,7 +1,7 @@
-675320779, 1.0__initial.sql
-840323734, 1.1.sql
--828985759, 1.2__dropsFor_1.1.sql
--1470028617, 1.3.sql
+168258180, 1.0__initial.sql
+-1449201260, 1.1.sql
+919151678, 1.2__dropsFor_1.1.sql
+-1031408459, 1.3.sql
-446860935, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.0__initial.sql
index 871dfe2de..be0dfa028 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.0__initial.sql
@@ -124,6 +124,14 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table `migtest_QuOtEd` (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer auto_increment not null,
name varchar(127) not null,
@@ -194,4 +202,5 @@ alter table `table` add constraint fk_table_foreign foreign key (`foreign`) refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
create index ix_table_from on `table` (`from`);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.1.sql
index a47607fa6..85849f0ff 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.1.sql
@@ -6,6 +6,7 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_indextest2;
alter table migtest_e_basic drop index uq_migtest_e_basic_indextest6;
drop index ix_migtest_e_basic_indextest1 on migtest_e_basic;
drop index ix_migtest_e_basic_indextest5 on migtest_e_basic;
+drop index ix_migtest_quoted_status1 on `migtest_QuOtEd`;
-- apply changes
create table migtest_e_user (
id integer auto_increment not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.2__dropsFor_1.1.sql
index 227ae4335..8d64a0804 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.2__dropsFor_1.1.sql
@@ -9,5 +9,6 @@ CALL usp_ebean_drop_column('migtest_e_basic', 'eref_id');
CALL usp_ebean_drop_column('migtest_e_history2', 'obsolete_string1');
CALL usp_ebean_drop_column('migtest_e_history2', 'obsolete_string2');
-- apply post alter
+drop table if exists `migtest_QuOtEd`;
drop table if exists migtest_e_ref;
drop sequence if exists migtest_e_ref_seq;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.3.sql
index f0c10c5ed..fc633abc6 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/1.3.sql
@@ -14,6 +14,14 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_indextest5;
drop index ix_migtest_e_basic_indextest3 on migtest_e_basic;
drop index ix_migtest_e_basic_indextest6 on migtest_e_basic;
-- apply changes
+create table `migtest_QuOtEd` (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer auto_increment not null,
name varchar(127) not null,
@@ -58,3 +66,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/idx_mariadb.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/idx_mariadb.migrations
index 241588a15..3574d5edc 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/idx_mariadb.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mariadb/idx_mariadb.migrations
@@ -1,8 +1,8 @@
1835064798, I__create_procs.sql
-675320779, 1.0__initial.sql
-840323734, 1.1.sql
-2123392915, 1.2__dropsFor_1.1.sql
--1470028617, 1.3.sql
+168258180, 1.0__initial.sql
+-1449201260, 1.1.sql
+1187950993, 1.2__dropsFor_1.1.sql
+-1031408459, 1.3.sql
-692020559, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.0__initial.model.xml b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.0__initial.model.xml
index 082c9bd3a..c58d005d9 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.0__initial.model.xml
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.0__initial.model.xml
@@ -91,6 +91,12 @@
+
+
+
+
+
+
@@ -127,6 +133,7 @@
+
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.1.model.xml b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.1.model.xml
index 2b7b577e3..27bfee165 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.1.model.xml
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.1.model.xml
@@ -106,6 +106,7 @@
+
@@ -117,6 +118,7 @@
+
\ No newline at end of file
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.2__dropsFor_1.1.model.xml b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.2__dropsFor_1.1.model.xml
index ff94a6767..99fa64365 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.2__dropsFor_1.1.model.xml
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.2__dropsFor_1.1.model.xml
@@ -7,6 +7,7 @@
+
\ No newline at end of file
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.3.model.xml b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.3.model.xml
index 1609ed17f..ca95c8f6d 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.3.model.xml
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/model/1.3.model.xml
@@ -35,6 +35,12 @@
+
+
+
+
+
+
@@ -47,6 +53,7 @@
+
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.0__initial.sql
index 99d169187..bcd621077 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.0__initial.sql
@@ -124,6 +124,14 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table `migtest_QuOtEd` (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer auto_increment not null,
name varchar(127) not null,
@@ -321,4 +329,5 @@ alter table `table` add constraint fk_table_foreign foreign key (`foreign`) refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
create index ix_table_from on `table` (`from`);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.1.sql
index 566c73b8f..0f24ccc5f 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.1.sql
@@ -6,6 +6,7 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_indextest2;
alter table migtest_e_basic drop index uq_migtest_e_basic_indextest6;
drop index ix_migtest_e_basic_indextest1 on migtest_e_basic;
drop index ix_migtest_e_basic_indextest5 on migtest_e_basic;
+drop index ix_migtest_quoted_status1 on `migtest_QuOtEd`;
-- apply changes
create table migtest_e_user (
id integer auto_increment not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.2__dropsFor_1.1.sql
index 47dc655fd..2c06ee001 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.2__dropsFor_1.1.sql
@@ -25,4 +25,5 @@ create trigger migtest_e_history2_history_del before delete on migtest_e_history
insert into migtest_e_history2_history (sys_period_start,sys_period_end,id, test_string, test_string3, new_column) values (OLD.sys_period_start, now(6),OLD.id, OLD.test_string, OLD.test_string3, OLD.new_column);
end$$
unlock tables;
+drop table if exists `migtest_QuOtEd`;
drop table if exists migtest_e_ref;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.3.sql
index 611437b14..59325f7c9 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/1.3.sql
@@ -14,6 +14,14 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_indextest5;
drop index ix_migtest_e_basic_indextest3 on migtest_e_basic;
drop index ix_migtest_e_basic_indextest6 on migtest_e_basic;
-- apply changes
+create table `migtest_QuOtEd` (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer auto_increment not null,
name varchar(127) not null,
@@ -124,5 +132,6 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
create index ix_m12_otoc72 on migtest_oto_child (name);
create index ix_migtest_oto_master_name on migtest_oto_master (name);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/idx_mysql.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/idx_mysql.migrations
index d70a87087..ada5d352c 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/idx_mysql.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql/idx_mysql.migrations
@@ -1,8 +1,8 @@
1835064798, I__create_procs.sql
-1464726622, 1.0__initial.sql
-1321178229, 1.1.sql
--1332434945, 1.2__dropsFor_1.1.sql
--105506677, 1.3.sql
+-1894322966, 1.0__initial.sql
+718635669, 1.1.sql
+-1097227916, 1.2__dropsFor_1.1.sql
+-1972055805, 1.3.sql
379252952, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.0__initial.sql
index 72f4c0ebf..57e31e712 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.0__initial.sql
@@ -124,6 +124,14 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table `migtest_QuOtEd` (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer auto_increment not null,
name varchar(127) not null,
@@ -321,4 +329,5 @@ alter table `table` add constraint fk_table_foreign foreign key (`foreign`) refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
create index ix_table_from on `table` (`from`);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.1.sql
index 566c73b8f..0f24ccc5f 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.1.sql
@@ -6,6 +6,7 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_indextest2;
alter table migtest_e_basic drop index uq_migtest_e_basic_indextest6;
drop index ix_migtest_e_basic_indextest1 on migtest_e_basic;
drop index ix_migtest_e_basic_indextest5 on migtest_e_basic;
+drop index ix_migtest_quoted_status1 on `migtest_QuOtEd`;
-- apply changes
create table migtest_e_user (
id integer auto_increment not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.2__dropsFor_1.1.sql
index 47dc655fd..2c06ee001 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.2__dropsFor_1.1.sql
@@ -25,4 +25,5 @@ create trigger migtest_e_history2_history_del before delete on migtest_e_history
insert into migtest_e_history2_history (sys_period_start,sys_period_end,id, test_string, test_string3, new_column) values (OLD.sys_period_start, now(6),OLD.id, OLD.test_string, OLD.test_string3, OLD.new_column);
end$$
unlock tables;
+drop table if exists `migtest_QuOtEd`;
drop table if exists migtest_e_ref;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.3.sql
index 611437b14..59325f7c9 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/1.3.sql
@@ -14,6 +14,14 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_indextest5;
drop index ix_migtest_e_basic_indextest3 on migtest_e_basic;
drop index ix_migtest_e_basic_indextest6 on migtest_e_basic;
-- apply changes
+create table `migtest_QuOtEd` (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer auto_increment not null,
name varchar(127) not null,
@@ -124,5 +132,6 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
create index ix_m12_otoc72 on migtest_oto_child (name);
create index ix_migtest_oto_master_name on migtest_oto_master (name);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/idx_mysql.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/idx_mysql.migrations
index 0bdf6e4dc..29b7558c7 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/idx_mysql.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/mysql55/idx_mysql.migrations
@@ -1,8 +1,8 @@
1835064798, I__create_procs.sql
-782176262, 1.0__initial.sql
-1321178229, 1.1.sql
--1332434945, 1.2__dropsFor_1.1.sql
--105506677, 1.3.sql
+955526296, 1.0__initial.sql
+718635669, 1.1.sql
+-1097227916, 1.2__dropsFor_1.1.sql
+-1972055805, 1.3.sql
379252952, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.0__initial.sql
index b9c859753..02cb7f494 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.0__initial.sql
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -336,4 +346,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index ix_table_from on "table" ("from");
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.1.sql
index 7fff62c51..bd20899e8 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.1.sql
@@ -9,6 +9,7 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6;
alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status;
drop index if exists ix_migtest_e_basic_indextest1;
drop index if exists ix_migtest_e_basic_indextest5;
+drop index if exists ix_migtest_quoted_status1;
-- apply changes
create table migtest_e_user (
id integer generated by default as identity not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.2__dropsFor_1.1.sql
index 092105623..fc0eb25e3 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.2__dropsFor_1.1.sql
@@ -27,5 +27,6 @@ create or replace trigger migtest_e_history2_history_del for migtest_e_history2
end_trigger;
$$
+drop table if exists "migtest_QuOtEd";
drop table if exists migtest_e_ref;
drop sequence if exists migtest_e_ref_seq;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.3.sql
index 7362489e6..53837ffc5 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/1.3.sql
@@ -17,6 +17,16 @@ alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status;
drop index if exists ix_migtest_e_basic_indextest3;
drop index if exists ix_migtest_e_basic_indextest6;
-- apply changes
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -144,3 +154,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/idx_nuodb.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/idx_nuodb.migrations
index 51fdb15a3..5dcecaa58 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/idx_nuodb.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/nuodb/idx_nuodb.migrations
@@ -1,7 +1,7 @@
--357978944, 1.0__initial.sql
-1244774121, 1.1.sql
--424253630, 1.2__dropsFor_1.1.sql
--1988156517, 1.3.sql
+-355978970, 1.0__initial.sql
+-1099441011, 1.1.sql
+1530685455, 1.2__dropsFor_1.1.sql
+1263834751, 1.3.sql
-1189704269, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.0__initial.sql
index 02c9883f7..ced9cf2cd 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.0__initial.sql
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table "migtest_QuOtEd" (
+ id varchar2(255) not null,
+ status1 varchar2(1),
+ status2 varchar2(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id number(10) generated by default as identity not null,
name varchar2(127) not null,
@@ -191,4 +201,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index ix_table_from on "table" ("from");
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.1.sql
index 2dc2c5aff..7387c82f9 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.1.sql
@@ -54,6 +54,7 @@ end;
$$;
drop index ix_migtest_e_basic_indextest1;
drop index ix_migtest_e_basic_indextest5;
+drop index ix_migtest_quoted_status1;
-- apply changes
create table migtest_e_user (
id number(10) generated by default as identity not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.2__dropsFor_1.1.sql
index ccecef36d..e3b0dbb96 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.2__dropsFor_1.1.sql
@@ -7,6 +7,7 @@ alter table migtest_e_basic drop column eref_id;
alter table migtest_e_history2 drop column obsolete_string1;
alter table migtest_e_history2 drop column obsolete_string2;
-- apply post alter
+drop table "migtest_QuOtEd" cascade constraints purge;
drop table migtest_e_ref cascade constraints purge;
delimiter $$
declare
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.3.sql
index e84773a9b..14204acde 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/1.3.sql
@@ -89,6 +89,16 @@ $$;
drop index ix_migtest_e_basic_indextest3;
drop index ix_migtest_e_basic_indextest6;
-- apply changes
+create table "migtest_QuOtEd" (
+ id varchar2(255) not null,
+ status1 varchar2(1),
+ status2 varchar2(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id number(10) generated by default as identity not null,
name varchar2(127) not null,
@@ -146,3 +156,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/idx_oracle.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/idx_oracle.migrations
index c00b2991b..838bd4330 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/idx_oracle.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle/idx_oracle.migrations
@@ -1,7 +1,7 @@
--2071028889, 1.0__initial.sql
--1556388339, 1.1.sql
--582436324, 1.2__dropsFor_1.1.sql
--712179623, 1.3.sql
+1374133214, 1.0__initial.sql
+-1429935878, 1.1.sql
+930172034, 1.2__dropsFor_1.1.sql
+-1621367223, 1.3.sql
663051206, 1.4__dropsFor_1.3.sql
1357801733, R__oracle_only_views.sql
561281075, R__order_views.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.0__initial.sql
index d978faf0e..aeb4dc5a7 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.0__initial.sql
@@ -143,6 +143,16 @@ create table migtest_e_history6 (
);
create sequence migtest_e_history6_seq;
+create table "migtest_QuOtEd" (
+ id varchar2(255) not null,
+ status1 varchar2(1),
+ status2 varchar2(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id number(10) not null,
name varchar2(127) not null,
@@ -213,4 +223,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index ix_table_from on "table" ("from");
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.1.sql
index ef694fac8..b3e4d8d99 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.1.sql
@@ -54,6 +54,7 @@ end;
$$;
drop index ix_migtest_e_basic_indextest1;
drop index ix_migtest_e_basic_indextest5;
+drop index ix_migtest_quoted_status1;
-- apply changes
create table migtest_e_user (
id number(10) not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.2__dropsFor_1.1.sql
index ccecef36d..e3b0dbb96 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.2__dropsFor_1.1.sql
@@ -7,6 +7,7 @@ alter table migtest_e_basic drop column eref_id;
alter table migtest_e_history2 drop column obsolete_string1;
alter table migtest_e_history2 drop column obsolete_string2;
-- apply post alter
+drop table "migtest_QuOtEd" cascade constraints purge;
drop table migtest_e_ref cascade constraints purge;
delimiter $$
declare
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.3.sql
index 5c7882368..97091b812 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/1.3.sql
@@ -89,6 +89,16 @@ $$;
drop index ix_migtest_e_basic_indextest3;
drop index ix_migtest_e_basic_indextest6;
-- apply changes
+create table "migtest_QuOtEd" (
+ id varchar2(255) not null,
+ status1 varchar2(1),
+ status2 varchar2(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id number(10) not null,
name varchar2(127) not null,
@@ -147,3 +157,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/idx_oracle.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/idx_oracle.migrations
index 09ea3293a..b2f708a10 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/idx_oracle.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/oracle11/idx_oracle.migrations
@@ -1,7 +1,7 @@
--1110489114, 1.0__initial.sql
-1800537955, 1.1.sql
--582436324, 1.2__dropsFor_1.1.sql
--253819510, 1.3.sql
+1070168506, 1.0__initial.sql
+984602561, 1.1.sql
+930172034, 1.2__dropsFor_1.1.sql
+-144959080, 1.3.sql
663051206, 1.4__dropsFor_1.3.sql
1357801733, R__oracle_only_views.sql
561281075, R__order_views.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.0__initial.sql
index 65e967ce4..25f82c76d 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.0__initial.sql
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -349,6 +359,7 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
create index if not exists ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index if not exists ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index if not exists ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index if not exists ix_table_from on "table" ("from");
create index idxd_migtest_0 on migtest_oto_child using hash (upper(name)) where upper(name) = 'JIM';
create index concurrently if not exists ix_migtest_oto_child_lowername_id on migtest_oto_child (lower(name),id);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.1.sql
index b513afc92..c4c66c2d5 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.1.sql
@@ -9,6 +9,7 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6;
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
drop index if exists ix_migtest_e_basic_indextest1;
drop index if exists ix_migtest_e_basic_indextest5;
+drop index if exists ix_migtest_quoted_status1;
drop index if exists idxd_migtest_0;
drop index concurrently if exists ix_migtest_oto_child_lowername_id;
drop index if exists ix_migtest_oto_child_lowername;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.2__dropsFor_1.1.sql
index a9fef454c..7e6c96228 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.2__dropsFor_1.1.sql
@@ -37,5 +37,6 @@ create trigger migtest_e_history2_history_upd
before update or delete on migtest_e_history2
for each row execute procedure migtest_e_history2_history_version();
+drop table if exists "migtest_QuOtEd" cascade;
drop table if exists migtest_e_ref cascade;
drop sequence if exists migtest_e_ref_seq;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.3.sql
index 7ce64dc07..585f3ffb6 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/1.3.sql
@@ -17,6 +17,16 @@ alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_stat
drop index if exists ix_migtest_e_basic_indextest3;
drop index if exists ix_migtest_e_basic_indextest6;
-- apply changes
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -187,6 +197,7 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index if not exists ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index if not exists ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index if not exists ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index if not exists ix_m12_otoc71 on migtest_oto_child (name);
create unique index if not exists uq_m12_otoc71 on migtest_oto_child (lower(name));
create unique index if not exists ix_migtest_oto_master_lowername on migtest_oto_master (lower(name));
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/idx_postgres.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/idx_postgres.migrations
index c226913cb..7f9a10350 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/idx_postgres.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres/idx_postgres.migrations
@@ -1,7 +1,7 @@
--1738052304, 1.0__initial.sql
-376807442, 1.1.sql
--1098989118, 1.2__dropsFor_1.1.sql
-691388965, 1.3.sql
+1014378814, 1.0__initial.sql
+-2047324426, 1.1.sql
+-261111052, 1.2__dropsFor_1.1.sql
+1335621453, 1.3.sql
1729345905, 1.4__dropsFor_1.3.sql
783227075, R__multi_comments.sql
561281075, R__order_views.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.0__initial.sql
index c07f369a7..e319a8737 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.0__initial.sql
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id serial not null,
name varchar(127) not null,
@@ -349,6 +359,7 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
create index if not exists ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index if not exists ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index if not exists ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index if not exists ix_table_from on "table" ("from");
create index idxd_migtest_0 on migtest_oto_child using hash (upper(name)) where upper(name) = 'JIM';
create index concurrently if not exists ix_migtest_oto_child_lowername_id on migtest_oto_child (lower(name),id);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.1.sql
index 506c0fd73..7ec02b634 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.1.sql
@@ -9,6 +9,7 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6;
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
drop index if exists ix_migtest_e_basic_indextest1;
drop index if exists ix_migtest_e_basic_indextest5;
+drop index if exists ix_migtest_quoted_status1;
drop index if exists idxd_migtest_0;
drop index concurrently if exists ix_migtest_oto_child_lowername_id;
drop index if exists ix_migtest_oto_child_lowername;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.2__dropsFor_1.1.sql
index a9fef454c..7e6c96228 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.2__dropsFor_1.1.sql
@@ -37,5 +37,6 @@ create trigger migtest_e_history2_history_upd
before update or delete on migtest_e_history2
for each row execute procedure migtest_e_history2_history_version();
+drop table if exists "migtest_QuOtEd" cascade;
drop table if exists migtest_e_ref cascade;
drop sequence if exists migtest_e_ref_seq;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.3.sql
index 96a61e00a..401b5a211 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/1.3.sql
@@ -17,6 +17,16 @@ alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_stat
drop index if exists ix_migtest_e_basic_indextest3;
drop index if exists ix_migtest_e_basic_indextest6;
-- apply changes
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id serial not null,
name varchar(127) not null,
@@ -187,6 +197,7 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index if not exists ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index if not exists ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index if not exists ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index if not exists ix_m12_otoc71 on migtest_oto_child (name);
create unique index if not exists uq_m12_otoc71 on migtest_oto_child (lower(name));
create unique index if not exists ix_migtest_oto_master_lowername on migtest_oto_master (lower(name));
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/idx_postgres.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/idx_postgres.migrations
index d3179797a..3ed7fcf1d 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/idx_postgres.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/postgres9/idx_postgres.migrations
@@ -1,7 +1,7 @@
-1809459793, 1.0__initial.sql
--533983703, 1.1.sql
--1098989118, 1.2__dropsFor_1.1.sql
-376154634, 1.3.sql
+382349675, 1.0__initial.sql
+-606251140, 1.1.sql
+-261111052, 1.2__dropsFor_1.1.sql
+-893728811, 1.3.sql
1729345905, 1.4__dropsFor_1.3.sql
783227075, R__multi_comments.sql
561281075, R__order_views.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.0__initial.sql
index 40060b094..6f14a9835 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.0__initial.sql
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer auto_increment not null,
name varchar(127) not null,
@@ -191,4 +201,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index ix_table_from on "table" ("from");
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.1.sql
index 2541938d3..77d47122f 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.1.sql
@@ -9,6 +9,7 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6;
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
drop index if exists ix_migtest_e_basic_indextest1;
drop index if exists ix_migtest_e_basic_indextest5;
+drop index if exists ix_migtest_quoted_status1;
-- apply changes
create table migtest_e_user (
id integer auto_increment not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.2__dropsFor_1.1.sql
index 4ec79a34c..cb6860e63 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.2__dropsFor_1.1.sql
@@ -7,4 +7,5 @@ alter table migtest_e_basic drop column eref_id;
alter table migtest_e_history2 drop column obsolete_string1;
alter table migtest_e_history2 drop column obsolete_string2;
-- apply post alter
+drop table if exists "migtest_QuOtEd";
drop table if exists migtest_e_ref;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.3.sql
index 384260c79..e028819d5 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/1.3.sql
@@ -17,6 +17,16 @@ alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_stat
drop index if exists ix_migtest_e_basic_indextest3;
drop index if exists ix_migtest_e_basic_indextest6;
-- apply changes
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer auto_increment not null,
name varchar(127) not null,
@@ -74,3 +84,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/idx_sqlanywhere.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/idx_sqlanywhere.migrations
index ea4b69483..332ef94bd 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/idx_sqlanywhere.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlanywhere/idx_sqlanywhere.migrations
@@ -1,6 +1,6 @@
-322064344, 1.0__initial.sql
-1152745318, 1.1.sql
-1279151426, 1.2__dropsFor_1.1.sql
--1467142599, 1.3.sql
+736698620, 1.0__initial.sql
+-2028417735, 1.1.sql
+688811494, 1.2__dropsFor_1.1.sql
+-2020328769, 1.3.sql
80209848, 1.4__dropsFor_1.3.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.0__initial.sql
index 446fda37e..0c2e27345 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.0__initial.sql
@@ -130,6 +130,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer not null,
name varchar(127) not null,
@@ -182,4 +192,5 @@ create table migtest_oto_master (
-- foreign keys and indices
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index ix_table_from on "table" ("from");
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.1.sql
index 1b1d797e6..817a25a1a 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.1.sql
@@ -9,6 +9,7 @@
-- not supported: alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
drop index if exists ix_migtest_e_basic_indextest1;
drop index if exists ix_migtest_e_basic_indextest5;
+drop index if exists ix_migtest_quoted_status1;
-- apply changes
create table migtest_e_user (
id integer not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.2__dropsFor_1.1.sql
index 4ec79a34c..cb6860e63 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.2__dropsFor_1.1.sql
@@ -7,4 +7,5 @@ alter table migtest_e_basic drop column eref_id;
alter table migtest_e_history2 drop column obsolete_string1;
alter table migtest_e_history2 drop column obsolete_string2;
-- apply post alter
+drop table if exists "migtest_QuOtEd";
drop table if exists migtest_e_ref;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.3.sql
index 0b0f96b0b..01458d882 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/1.3.sql
@@ -17,6 +17,16 @@
drop index if exists ix_migtest_e_basic_indextest3;
drop index if exists ix_migtest_e_basic_indextest6;
-- apply changes
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer not null,
name varchar(127) not null,
@@ -70,3 +80,4 @@ create index ix_migtest_e_basic_eref_id on migtest_e_basic (eref_id);
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/idx_sqlite.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/idx_sqlite.migrations
index 75273e48d..6be96bfdf 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/idx_sqlite.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlite/idx_sqlite.migrations
@@ -1,7 +1,7 @@
-587945719, 1.0__initial.sql
--752421071, 1.1.sql
-1279151426, 1.2__dropsFor_1.1.sql
-18475685, 1.3.sql
+346470730, 1.0__initial.sql
+-494516322, 1.1.sql
+688811494, 1.2__dropsFor_1.1.sql
+1092030960, 1.3.sql
80209848, 1.4__dropsFor_1.3.sql
2034589659, R__order_views_sqlite.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.0__initial.sql
index 0ceba76cc..756c7bce8 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.0__initial.sql
@@ -125,6 +125,15 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table [migtest_QuOtEd] (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer identity(1,1) not null,
name varchar(127) not null,
@@ -198,6 +207,7 @@ alter table migtest_e_history6
sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999',
period for system_time (sys_periodFrom, sys_periodTo);
alter table migtest_e_history6 set (system_versioning = on (history_table=dbo.migtest_e_history6_history));
+create unique nonclustered index uq_migtest_quoted_status2 on "migtest_QuOtEd"(status2) where status2 is not null;
alter table migtest_e_ref add constraint uq_migtest_e_ref_name unique (name);
create unique nonclustered index uq_table_to on "table"("to") where "to" is not null;
create unique nonclustered index uq_table_varchar on "table"("varchar") where "varchar" is not null;
@@ -221,4 +231,5 @@ alter table [table] add constraint fk_table_foreign foreign key ([foreign]) refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on [migtest_QuOtEd] (status1);
create index ix_table_from on [table] ([from]);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.1.sql
index 7552a3c6b..c49d94bba 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.1.sql
@@ -11,6 +11,7 @@ IF OBJECT_ID('uq_migtest_e_basic_indextest6', 'UQ') IS NOT NULL alter table migt
IF OBJECT_ID('ck_migtest_e_enum_test_status', 'C') IS NOT NULL alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status;
IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_basic','U') AND name = 'ix_migtest_e_basic_indextest1') drop index ix_migtest_e_basic_indextest1 ON migtest_e_basic;
IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_basic','U') AND name = 'ix_migtest_e_basic_indextest5') drop index ix_migtest_e_basic_indextest5 ON migtest_e_basic;
+IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('"migtest_QuOtEd"','U') AND name = 'ix_migtest_quoted_status1') drop index ix_migtest_quoted_status1 ON "migtest_QuOtEd";
-- apply changes
create table migtest_e_user (
id integer identity(1,1) not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.2__dropsFor_1.1.sql
index 36fa8d503..e37f34d7c 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.2__dropsFor_1.1.sql
@@ -11,5 +11,6 @@ EXEC usp_ebean_drop_column migtest_e_basic, eref_id;
EXEC usp_ebean_drop_column migtest_e_history2, obsolete_string1;
EXEC usp_ebean_drop_column migtest_e_history2, obsolete_string2;
-- apply post alter
+IF OBJECT_ID('"migtest_QuOtEd"', 'U') IS NOT NULL drop table "migtest_QuOtEd";
IF OBJECT_ID('migtest_e_ref', 'U') IS NOT NULL drop table migtest_e_ref;
IF OBJECT_ID('migtest_e_ref_seq', 'SO') IS NOT NULL drop sequence migtest_e_ref_seq;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.3.sql
index 2fde6f6da..7802b1395 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/1.3.sql
@@ -22,6 +22,15 @@ IF OBJECT_ID('ck_migtest_e_enum_test_status', 'C') IS NOT NULL alter table migte
IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_basic','U') AND name = 'ix_migtest_e_basic_indextest3') drop index ix_migtest_e_basic_indextest3 ON migtest_e_basic;
IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_basic','U') AND name = 'ix_migtest_e_basic_indextest6') drop index ix_migtest_e_basic_indextest6 ON migtest_e_basic;
-- apply changes
+create table [migtest_QuOtEd] (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer identity(1,1) not null,
name varchar(127) not null,
@@ -76,6 +85,7 @@ EXEC usp_ebean_drop_default_constraint migtest_e_history6, test_number2;
alter table migtest_e_history6 alter column test_number2 integer not null;
alter table migtest_e_history6 add default 7 for test_number2;
-- apply post alter
+create unique nonclustered index uq_migtest_quoted_status2 on "migtest_QuOtEd"(status2) where status2 is not null;
alter table migtest_e_ref add constraint uq_migtest_e_ref_name unique (name);
alter table migtest_e_basic add constraint ck_migtest_e_basic_status check ( status in ('N','A','I'));
alter table migtest_e_basic add constraint ck_migtest_e_basic_status2 check ( status2 in ('N','A','I'));
@@ -90,3 +100,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on [migtest_QuOtEd] (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/idx_sqlserver.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/idx_sqlserver.migrations
index 0e3158837..ebfba40ea 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/idx_sqlserver.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver16/idx_sqlserver.migrations
@@ -1,8 +1,8 @@
-2122378240, I__create_procs.sql
--177269726, 1.0__initial.sql
-708685501, 1.1.sql
--1687762822, 1.2__dropsFor_1.1.sql
-155669224, 1.3.sql
+-1324388010, 1.0__initial.sql
+1826995096, 1.1.sql
+-1431095657, 1.2__dropsFor_1.1.sql
+-2048567958, 1.3.sql
-410961452, 1.4__dropsFor_1.3.sql
1607822082, R__order_views_mssql.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.0__initial.sql
index df8c1c702..caf403e9b 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.0__initial.sql
@@ -141,6 +141,15 @@ create table migtest_e_history6 (
);
create sequence migtest_e_history6_seq as bigint start with 1;
+create table [migtest_QuOtEd] (
+ id nvarchar(255) not null,
+ status1 nvarchar(1),
+ status2 nvarchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer not null,
name nvarchar(127) not null,
@@ -220,6 +229,7 @@ alter table migtest_e_history6
sys_periodTo datetime2 GENERATED ALWAYS AS ROW END NOT NULL DEFAULT '9999-12-31T23:59:59.9999999',
period for system_time (sys_periodFrom, sys_periodTo);
alter table migtest_e_history6 set (system_versioning = on (history_table=dbo.migtest_e_history6_history));
+create unique nonclustered index uq_migtest_quoted_status2 on "migtest_QuOtEd"(status2) where status2 is not null;
alter table migtest_e_ref add constraint uq_migtest_e_ref_name unique (name);
create unique nonclustered index uq_table_to on "table"("to") where "to" is not null;
create unique nonclustered index uq_table_varchar on "table"("varchar") where "varchar" is not null;
@@ -243,4 +253,5 @@ alter table [table] add constraint fk_table_foreign foreign key ([foreign]) refe
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on [migtest_QuOtEd] (status1);
create index ix_table_from on [table] ([from]);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.1.sql
index 91fdef093..65587451a 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.1.sql
@@ -11,6 +11,7 @@ IF OBJECT_ID('uq_migtest_e_basic_indextest6', 'UQ') IS NOT NULL alter table migt
IF OBJECT_ID('ck_migtest_e_enum_test_status', 'C') IS NOT NULL alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status;
IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_basic','U') AND name = 'ix_migtest_e_basic_indextest1') drop index ix_migtest_e_basic_indextest1 ON migtest_e_basic;
IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_basic','U') AND name = 'ix_migtest_e_basic_indextest5') drop index ix_migtest_e_basic_indextest5 ON migtest_e_basic;
+IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('"migtest_QuOtEd"','U') AND name = 'ix_migtest_quoted_status1') drop index ix_migtest_quoted_status1 ON "migtest_QuOtEd";
-- apply changes
create table migtest_e_user (
id integer not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.2__dropsFor_1.1.sql
index 36fa8d503..e37f34d7c 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.2__dropsFor_1.1.sql
@@ -11,5 +11,6 @@ EXEC usp_ebean_drop_column migtest_e_basic, eref_id;
EXEC usp_ebean_drop_column migtest_e_history2, obsolete_string1;
EXEC usp_ebean_drop_column migtest_e_history2, obsolete_string2;
-- apply post alter
+IF OBJECT_ID('"migtest_QuOtEd"', 'U') IS NOT NULL drop table "migtest_QuOtEd";
IF OBJECT_ID('migtest_e_ref', 'U') IS NOT NULL drop table migtest_e_ref;
IF OBJECT_ID('migtest_e_ref_seq', 'SO') IS NOT NULL drop sequence migtest_e_ref_seq;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.3.sql
index de600ddb1..055b0d489 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/1.3.sql
@@ -22,6 +22,15 @@ IF OBJECT_ID('ck_migtest_e_enum_test_status', 'C') IS NOT NULL alter table migte
IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_basic','U') AND name = 'ix_migtest_e_basic_indextest3') drop index ix_migtest_e_basic_indextest3 ON migtest_e_basic;
IF EXISTS (SELECT name FROM sys.indexes WHERE object_id = OBJECT_ID('migtest_e_basic','U') AND name = 'ix_migtest_e_basic_indextest6') drop index ix_migtest_e_basic_indextest6 ON migtest_e_basic;
-- apply changes
+create table [migtest_QuOtEd] (
+ id nvarchar(255) not null,
+ status1 nvarchar(1),
+ status2 nvarchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer not null,
name nvarchar(127) not null,
@@ -77,6 +86,7 @@ EXEC usp_ebean_drop_default_constraint migtest_e_history6, test_number2;
alter table migtest_e_history6 alter column test_number2 integer not null;
alter table migtest_e_history6 add default 7 for test_number2;
-- apply post alter
+create unique nonclustered index uq_migtest_quoted_status2 on "migtest_QuOtEd"(status2) where status2 is not null;
alter table migtest_e_ref add constraint uq_migtest_e_ref_name unique (name);
alter table migtest_e_basic add constraint ck_migtest_e_basic_status check ( status in ('N','A','I'));
alter table migtest_e_basic add constraint ck_migtest_e_basic_status2 check ( status2 in ('N','A','I'));
@@ -91,3 +101,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index ix_migtest_quoted_status1 on [migtest_QuOtEd] (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/idx_sqlserver.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/idx_sqlserver.migrations
index 0da8bb066..2e29648f1 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/idx_sqlserver.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/sqlserver17/idx_sqlserver.migrations
@@ -1,8 +1,8 @@
-2122378240, I__create_procs.sql
-1239366592, 1.0__initial.sql
-1829437030, 1.1.sql
--1687762822, 1.2__dropsFor_1.1.sql
--476460378, 1.3.sql
+2004279493, 1.0__initial.sql
+848757422, 1.1.sql
+-1431095657, 1.2__dropsFor_1.1.sql
+294205466, 1.3.sql
-410961452, 1.4__dropsFor_1.3.sql
1607822082, R__order_views_mssql.sql
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.0__initial.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.0__initial.sql
index 8cdb3c45a..91c6c6fc5 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.0__initial.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.0__initial.sql
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id)
);
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -379,4 +389,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
create index if not exists ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index if not exists ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index if not exists ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
create index if not exists ix_table_from on "table" ("from");
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.1.sql
index d9fa995a0..eb0a03e75 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.1.sql
@@ -9,6 +9,7 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6;
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
drop index if exists ix_migtest_e_basic_indextest1;
drop index if exists ix_migtest_e_basic_indextest5;
+drop index if exists ix_migtest_quoted_status1;
-- apply changes
create table migtest_e_user (
id integer generated by default as identity not null,
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.2__dropsFor_1.1.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.2__dropsFor_1.1.sql
index a9fef454c..7e6c96228 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.2__dropsFor_1.1.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.2__dropsFor_1.1.sql
@@ -37,5 +37,6 @@ create trigger migtest_e_history2_history_upd
before update or delete on migtest_e_history2
for each row execute procedure migtest_e_history2_history_version();
+drop table if exists "migtest_QuOtEd" cascade;
drop table if exists migtest_e_ref cascade;
drop sequence if exists migtest_e_ref_seq;
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.3.sql b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.3.sql
index 29fb9e62b..4b04c0cbb 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.3.sql
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/1.3.sql
@@ -17,6 +17,16 @@ alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_stat
drop index if exists ix_migtest_e_basic_indextest3;
drop index if exists ix_migtest_e_basic_indextest6;
-- apply changes
+create table "migtest_QuOtEd" (
+ id varchar(255) not null,
+ status1 varchar(1),
+ status2 varchar(1),
+ constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
+ constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
+ constraint uq_migtest_quoted_status2 unique (status2),
+ constraint pk_migtest_quoted primary key (id)
+);
+
create table migtest_e_ref (
id integer generated by default as identity not null,
name varchar(127) not null,
@@ -187,3 +197,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
create index if not exists ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
create index if not exists ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
+create index if not exists ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
diff --git a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/idx_yugabyte.migrations b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/idx_yugabyte.migrations
index 05f50b829..ccba036e5 100644
--- a/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/idx_yugabyte.migrations
+++ b/ebean-test/src/test/resources/migrationtest/dbmigration/yugabyte/idx_yugabyte.migrations
@@ -1,7 +1,7 @@
--967136529, 1.0__initial.sql
--1547662237, 1.1.sql
--1098989118, 1.2__dropsFor_1.1.sql
-1877712595, 1.3.sql
+1497343697, 1.0__initial.sql
+1748254498, 1.1.sql
+-261111052, 1.2__dropsFor_1.1.sql
+-158984239, 1.3.sql
1729345905, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql