Merge branch 'master' of github.com:ebean-orm/ebean

This commit is contained in:
Rob Bygrave committed 2022-03-23 22:29:16 +13:00
commit 79213e7194
135 files changed
+1064 -372

No files matched your search

+13 -29
View File
@@ -3,7 +3,6 @@
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/ebean-orm/ebean/blob/master/LICENSE) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/ebean-orm/ebean/blob/master/LICENSE)
[![Multi-JDK Build](https://github.com/ebean-orm/ebean/actions/workflows/multi-jdk-build.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/multi-jdk-build.yml) [![Multi-JDK Build](https://github.com/ebean-orm/ebean/actions/workflows/multi-jdk-build.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/multi-jdk-build.yml)
[![JDK 18-ea](https://github.com/ebean-orm/ebean/actions/workflows/jdk-18-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/jdk-18-ea.yml) [![JDK 18-ea](https://github.com/ebean-orm/ebean/actions/workflows/jdk-18-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/jdk-18-ea.yml)
[![JDK EA](https://github.com/ebean-orm/ebean/actions/workflows/jdk-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/jdk-ea.yml)
[![H2Database](https://github.com/ebean-orm/ebean/actions/workflows/h2database.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/h2database.yml) [![H2Database](https://github.com/ebean-orm/ebean/actions/workflows/h2database.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/h2database.yml)
[![Postgres](https://github.com/ebean-orm/ebean/actions/workflows/postgres.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/postgres.yml) [![Postgres](https://github.com/ebean-orm/ebean/actions/workflows/postgres.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/postgres.yml)
@@ -12,6 +11,15 @@
[![SqlServer](https://github.com/ebean-orm/ebean/actions/workflows/sqlserver.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/sqlserver.yml) [![SqlServer](https://github.com/ebean-orm/ebean/actions/workflows/sqlserver.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/sqlserver.yml)
[![Yugabyte](https://github.com/ebean-orm/ebean/actions/workflows/yugabyte.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/yugabyte.yml) [![Yugabyte](https://github.com/ebean-orm/ebean/actions/workflows/yugabyte.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/yugabyte.yml)
#### Builds against EA (Early Access) versions of Java (19, Loom, panama etc)
[![ebean EA](https://github.com/ebean-orm/ebean/actions/workflows/jdk-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean/actions/workflows/jdk-ea.yml)
[![datasource EA](https://github.com/ebean-orm/ebean-datasource/actions/workflows/jdk-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean-datasource/actions/workflows/jdk-ea.yml)
[![migration EA](https://github.com/ebean-orm/ebean-migration/actions/workflows/jdk-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean-migration/actions/workflows/jdk-ea.yml)
[![test-docker EA](https://github.com/ebean-orm/ebean-test-docker/actions/workflows/jdk-ea.yml/badge.svg)](https://github.com/ebean-orm/ebean-test-docker/actions/workflows/jdk-ea.yml)
# Sponsors # Sponsors
<table> <table>
<tbody> <tbody>
@@ -40,39 +48,15 @@
</tbody> </tbody>
</table> </table>
# Need help? ## Need help?
Post questions or issues to the Ebean google group - https://groups.google.com/forum/#!forum/ebean 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/) Goto [https://ebean.io/docs/](https://ebean.io/docs/)
## Maven central links: ## Maven central
[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 - io.ebean](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.ebean%22%20)
[Maven central - all related projects](http://search.maven.org/#search%7Cga%7C1%7Cebean "maven central all related projects")
## Early access builds
<p>
<a href="https://github.com/ebean-orm/ebean/actions/workflows/jdk-ea.yml">
<img alt="ebean EA" src="https://img.shields.io/github/workflow/status/ebean-orm/ebean/JDK%20EA?label=ebean%20EA">
</a>
<a href="https://github.com/ebean-orm/ebean-datasource/actions/workflows/jdk-ea.yml">
<img alt="ebean-datasource EA" src="https://img.shields.io/github/workflow/status/ebean-orm/ebean-datasource/JDK%20EA?label=ebean-datasource%20EA">
</a>
<a href="https://github.com/ebean-orm/ebean-migration/actions/workflows/jdk-ea.yml">
<img alt="ebean-migration EA" src="https://img.shields.io/github/workflow/status/ebean-orm/ebean-migration/JDK%20EA?label=ebean-migration%20EA">
</a>
</p>
<p>
<a href="https://github.com/ebean-orm/ebean/actions/workflows/jdk-ea.yml">
<img src="https://github.com/ebean-orm/ebean/actions/workflows/jdk-ea.yml/badge.svg" alt="ebean" style="max-width: 100%;">
</a>
<a href="https://github.com/ebean-orm/ebean-datasource/actions/workflows/jdk-ea.yml">
<img src="https://github.com/ebean-orm/ebean-datasource/actions/workflows/jdk-ea.yml/badge.svg" alt="ebean-datasource" style="max-width: 100%;">
</a>
</p>
@@ -4,7 +4,6 @@ import io.ebean.annotation.Platform;
import io.ebean.config.DatabaseConfig; import io.ebean.config.DatabaseConfig;
import io.ebean.config.DbConstraintNaming; import io.ebean.config.DbConstraintNaming;
import io.ebean.config.NamingConvention; import io.ebean.config.NamingConvention;
import io.ebean.config.dbplatform.DbHistorySupport;
import io.ebean.config.dbplatform.IdType; import io.ebean.config.dbplatform.IdType;
import io.ebean.util.StringHelper; import io.ebean.util.StringHelper;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer; import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer;
@@ -62,7 +61,7 @@ public class BaseTableDdl implements TableDdl {
private final boolean strictMode; 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. * 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 = platformDdl;
this.platformDdl.configure(config); this.platformDdl.configure(config);
this.strictMode = config.isDdlStrictMode(); this.strictMode = config.isDdlStrictMode();
DbHistorySupport hist = platformDdl.getPlatform().getHistorySupport(); if (platformDdl.historyDdl instanceof PlatformHistoryDdl.TableBased) {
if (hist == null) { this.tableHistory = (PlatformHistoryDdl.TableBased) platformDdl.historyDdl;
this.alterHistoryTables = false;
} else { } else {
this.alterHistoryTables = platformDdl.historyDdl.alterHistoryTables(); this.tableHistory = null;
} }
} }
@@ -634,8 +632,8 @@ public class BaseTableDdl implements TableDdl {
if (isTrue(addColumn.isWithHistory())) { if (isTrue(addColumn.isWithHistory())) {
platformDdl.regenerateHistoryTriggers(writer, tableName); platformDdl.regenerateHistoryTriggers(writer, tableName);
// make same changes to the history table // make same changes to the history table
if (alterHistoryTables) { if (tableHistory != null) {
String historyTable = historyTable(tableName); String historyTable = tableHistory.historyTableName(tableName);
for (Column column : columns) { for (Column column : columns) {
alterTableAddColumn(writer, historyTable, column, true, true); alterTableAddColumn(writer, historyTable, column, true, true);
} }
@@ -694,8 +692,8 @@ public class BaseTableDdl implements TableDdl {
if (isTrue(dropColumn.isWithHistory())) { if (isTrue(dropColumn.isWithHistory())) {
platformDdl.regenerateHistoryTriggers(writer, tableName); platformDdl.regenerateHistoryTriggers(writer, tableName);
// also drop from the history table // also drop from the history table
if (alterHistoryTables) { if (tableHistory != null) {
alterTableDropColumn(writer, historyTable(tableName), dropColumn.getColumnName()); 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()); 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. * alter all the base attributes (type/default/notnull) of the column together.
* Some platforms (like mysql/sqlserver/hana) must do that in one statement, * Some platforms (like mysql/sqlserver/hana) must do that in one statement,
@@ -800,9 +791,9 @@ public class BaseTableDdl implements TableDdl {
} }
if (applyToHistory) { if (applyToHistory) {
platformDdl.regenerateHistoryTriggers(writer, alter.getTableName()); platformDdl.regenerateHistoryTriggers(writer, alter.getTableName());
if (alterHistoryTables) { if (tableHistory != null) {
AlterColumn alterHistoryColumn = new AlterColumn(); AlterColumn alterHistoryColumn = new AlterColumn();
alterHistoryColumn.setTableName(historyTable(alter.getTableName())); alterHistoryColumn.setTableName(tableHistory.historyTableName(alter.getTableName()));
alterHistoryColumn.setColumnName(alter.getColumnName()); alterHistoryColumn.setColumnName(alter.getColumnName());
// ignore default value (not needed on history tables) // ignore default value (not needed on history tables)
alterHistoryColumn.setCurrentType(alter.getCurrentType()); alterHistoryColumn.setCurrentType(alter.getCurrentType());
@@ -104,15 +104,21 @@ public class DB2Ddl extends PlatformDdl {
+ "\n" + dropIndex(uniqueConstraintName, tableName); + "\n" + dropIndex(uniqueConstraintName, tableName);
} }
private void assertNoSchema(String objName) {
if (objName.indexOf('.') != -1) {
throw new UnsupportedOperationException("Schemas are not yet supported. ObjectName: '" + objName + "'");
}
}
@Override @Override
public String alterTableDropConstraint(String tableName, String constraintName) { public String alterTableDropConstraint(String tableName, String constraintName) {
assertNoSchema(tableName);
StringBuilder sb = new StringBuilder(300); StringBuilder sb = new StringBuilder(300);
sb.append("delimiter $$\n") sb.append("delimiter $$\n")
.append("begin\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(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(" prepare stmt from 'alter table ").append(tableName)
.append(" drop constraint ").append(maxConstraintName(constraintName)).append("';\n") .append(" drop constraint ").append(maxConstraintName(constraintName)).append("';\n")
@@ -126,10 +132,11 @@ public class DB2Ddl extends PlatformDdl {
@Override @Override
public String dropIndex(String indexName, String tableName, boolean concurrent) { public String dropIndex(String indexName, String tableName, boolean concurrent) {
assertNoSchema(indexName);
StringBuilder sb = new StringBuilder(300); StringBuilder sb = new StringBuilder(300);
sb.append("delimiter $$\n") sb.append("delimiter $$\n")
.append("begin\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(maxConstraintName(indexName).toUpperCase()).append("') then\n")
.append(" prepare stmt from 'drop index ").append(maxConstraintName(indexName)).append("';\n") .append(" prepare stmt from 'drop index ").append(maxConstraintName(indexName)).append("';\n")
.append(" execute stmt;\n") .append(" execute stmt;\n")
@@ -140,10 +147,11 @@ public class DB2Ddl extends PlatformDdl {
@Override @Override
public String dropSequence(String sequenceName) { public String dropSequence(String sequenceName) {
assertNoSchema(sequenceName);
StringBuilder sb = new StringBuilder(300); StringBuilder sb = new StringBuilder(300);
sb.append("delimiter $$\n"); sb.append("delimiter $$\n");
sb.append("begin\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"); .append(maxConstraintName(sequenceName).toUpperCase()).append("') then\n");
sb.append(" prepare stmt from 'drop sequence ").append(maxConstraintName(sequenceName)).append("';\n"); sb.append(" prepare stmt from 'drop sequence ").append(maxConstraintName(sequenceName)).append("';\n");
sb.append(" execute stmt;\n"); sb.append(" execute stmt;\n");
@@ -1,7 +1,6 @@
package io.ebeaninternal.dbmigration.ddlgeneration.platform; package io.ebeaninternal.dbmigration.ddlgeneration.platform;
import io.ebean.config.DatabaseConfig; import io.ebean.config.DatabaseConfig;
import io.ebean.config.DbConstraintNaming;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlAlterTable; import io.ebeaninternal.dbmigration.ddlgeneration.DdlAlterTable;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer; import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite; import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite;
@@ -14,29 +13,24 @@ import io.ebeaninternal.dbmigration.model.MTable;
* *
* @author Roland Praml, FOCONIS AG * @author Roland Praml, FOCONIS AG
*/ */
public class Db2HistoryDdl implements PlatformHistoryDdl { public class Db2HistoryDdl extends DbTableBasedHistoryDdl implements PlatformHistoryDdl {
private String systemPeriodStart; private String systemPeriodStart;
private String systemPeriodEnd; private String systemPeriodEnd;
private String transactionId; private String transactionId;
private PlatformDdl platformDdl;
private DbConstraintNaming constraintNaming;
private String historySuffix;
@Override @Override
public void configure(DatabaseConfig config, PlatformDdl platformDdl) { public void configure(DatabaseConfig config, PlatformDdl platformDdl) {
super.configure(config, platformDdl);
this.systemPeriodStart = config.getAsOfSysPeriod() + "_start"; this.systemPeriodStart = config.getAsOfSysPeriod() + "_start";
this.systemPeriodEnd = config.getAsOfSysPeriod() + "_end"; this.systemPeriodEnd = config.getAsOfSysPeriod() + "_end";
this.transactionId = config.getAsOfSysPeriod() + "_txn"; // required for DB2 this.transactionId = config.getAsOfSysPeriod() + "_txn"; // required for DB2
this.platformDdl = platformDdl;
this.constraintNaming = config.getConstraintNaming();
this.historySuffix = config.getHistoryTableSuffix();
} }
@Override @Override
public void createWithHistory(DdlWrite writer, MTable table) { public void createWithHistory(DdlWrite writer, MTable table) {
String tableName = table.getName(); 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) // DB2 requires an EXACT copy (same column types with null/non-null, same order)
addSysPeriodColumns(writer, tableName); addSysPeriodColumns(writer, tableName);
@@ -85,7 +79,7 @@ public class Db2HistoryDdl implements PlatformHistoryDdl {
platformDdl.alterTableDropColumn(writer, baseTable, transactionId); platformDdl.alterTableDropColumn(writer, baseTable, transactionId);
// drop the history table // drop the history table
writer.applyPostAlter().append("drop table ").append(historyTable(baseTable)).endOfStatement(); writer.applyPostAlter().append("drop table ").append(historyTableName(baseTable)).endOfStatement();
} }
@Override @Override
@@ -97,10 +91,6 @@ public class Db2HistoryDdl implements PlatformHistoryDdl {
createWithHistory(writer, table); createWithHistory(writer, table);
} }
@Override
public boolean alterHistoryTables() {
return true;
}
@Override @Override
public void updateTriggers(DdlWrite writer, String tableName) { public void updateTriggers(DdlWrite writer, String tableName) {
@@ -118,11 +108,7 @@ public class Db2HistoryDdl implements PlatformHistoryDdl {
} }
public void enableSystemVersioning(DdlBuffer apply, String tableName) { public void enableSystemVersioning(DdlBuffer apply, String tableName) {
apply.append("alter table ").append(tableName).append(" add versioning use history table ").append(historyTable(tableName)).endOfStatement(); apply.append("alter table ").append(tableName).append(" add versioning use history table ").append(historyTableName(tableName)).endOfStatement();
}
protected String historyTable(String tableName) {
return constraintNaming.normaliseTable(tableName) + historySuffix;
} }
} }
@@ -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);
}
}
@@ -1,7 +1,6 @@
package io.ebeaninternal.dbmigration.ddlgeneration.platform; package io.ebeaninternal.dbmigration.ddlgeneration.platform;
import io.ebean.config.DatabaseConfig; import io.ebean.config.DatabaseConfig;
import io.ebean.config.DbConstraintNaming;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlAlterTable; import io.ebeaninternal.dbmigration.ddlgeneration.DdlAlterTable;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer; import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite; import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite;
@@ -15,18 +14,14 @@ import java.util.List;
/** /**
* Uses DB triggers to maintain a history table. * Uses DB triggers to maintain a history table.
*/ */
public abstract class DbTriggerBasedHistoryDdl implements PlatformHistoryDdl { public abstract class DbTriggerBasedHistoryDdl extends DbTableBasedHistoryDdl implements PlatformHistoryDdl {
protected DbConstraintNaming constraintNaming;
protected PlatformDdl platformDdl;
protected String sysPeriod; protected String sysPeriod;
protected String sysPeriodStart; protected String sysPeriodStart;
protected String sysPeriodEnd; protected String sysPeriodEnd;
protected String viewSuffix; protected String viewSuffix;
protected String historySuffix;
protected String sysPeriodType = "datetime(6)"; protected String sysPeriodType = "datetime(6)";
protected String now = "now(6)"; protected String now = "now(6)";
@@ -37,11 +32,9 @@ public abstract class DbTriggerBasedHistoryDdl implements PlatformHistoryDdl {
@Override @Override
public void configure(DatabaseConfig config, PlatformDdl platformDdl) { public void configure(DatabaseConfig config, PlatformDdl platformDdl) {
this.platformDdl = platformDdl; super.configure(config, platformDdl);
this.sysPeriod = config.getAsOfSysPeriod(); this.sysPeriod = config.getAsOfSysPeriod();
this.viewSuffix = config.getAsOfViewSuffix(); this.viewSuffix = config.getAsOfViewSuffix();
this.historySuffix = config.getHistoryTableSuffix();
this.constraintNaming = config.getConstraintNaming();
this.sysPeriodStart = sysPeriod + "_start"; this.sysPeriodStart = sysPeriod + "_start";
this.sysPeriodEnd = sysPeriod + "_end"; this.sysPeriodEnd = sysPeriod + "_end";
@@ -121,33 +114,24 @@ public abstract class DbTriggerBasedHistoryDdl implements PlatformHistoryDdl {
protected abstract void dropTriggers(DdlBuffer buffer, String baseTable); 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) { protected String historyViewName(String baseTableName) {
return quote(normalise(baseTableName) + viewSuffix); return normalise(baseTableName, viewSuffix);
} }
protected String procedureName(String baseTableName) { protected String procedureName(String baseTableName) {
return normalise(baseTableName) + "_history_version"; return normalise(baseTableName, "_history_version");
} }
protected String triggerName(String baseTableName) { protected String triggerName(String baseTableName) {
return normalise(baseTableName) + "_history_upd"; return normalise(baseTableName, "_history_upd");
} }
protected String updateTriggerName(String baseTableName) { protected String updateTriggerName(String baseTableName) {
return normalise(baseTableName) + "_history_upd"; return normalise(baseTableName, "_history_upd");
} }
protected String deleteTriggerName(String baseTableName) { protected String deleteTriggerName(String baseTableName) {
return normalise(baseTableName) + "_history_del"; return normalise(baseTableName, "_history_del");
} }
protected void addSysPeriodColumns(DdlWrite writer, String baseTableName, String whenCreatedColumn) { protected void addSysPeriodColumns(DdlWrite writer, String baseTableName, String whenCreatedColumn) {
@@ -266,12 +250,5 @@ public abstract class DbTriggerBasedHistoryDdl implements PlatformHistoryDdl {
return table.allHistoryColumns(true); return table.allHistoryColumns(true);
} }
@Override
public boolean alterHistoryTables() {
return true;
}
protected String quote(String dbName) {
return platformDdl.quote(dbName);
}
} }
@@ -1,7 +1,6 @@
package io.ebeaninternal.dbmigration.ddlgeneration.platform; package io.ebeaninternal.dbmigration.ddlgeneration.platform;
import io.ebean.config.DatabaseConfig; import io.ebean.config.DatabaseConfig;
import io.ebean.config.DbConstraintNaming;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlAlterTable; import io.ebeaninternal.dbmigration.ddlgeneration.DdlAlterTable;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer; import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite; import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite;
@@ -12,21 +11,16 @@ import io.ebeaninternal.dbmigration.model.MTable;
import java.util.Collection; import java.util.Collection;
public class HanaHistoryDdl implements PlatformHistoryDdl { public class HanaHistoryDdl extends DbTableBasedHistoryDdl implements PlatformHistoryDdl {
private String systemPeriodStart; private String systemPeriodStart;
private String systemPeriodEnd; private String systemPeriodEnd;
private PlatformDdl platformDdl;
private DbConstraintNaming constraintNaming;
private String historySuffix;
@Override @Override
public void configure(DatabaseConfig config, PlatformDdl platformDdl) { public void configure(DatabaseConfig config, PlatformDdl platformDdl) {
super.configure(config, platformDdl);
this.systemPeriodStart = config.getAsOfSysPeriod() + "_start"; this.systemPeriodStart = config.getAsOfSysPeriod() + "_start";
this.systemPeriodEnd = config.getAsOfSysPeriod() + "_end"; this.systemPeriodEnd = config.getAsOfSysPeriod() + "_end";
this.platformDdl = platformDdl;
this.constraintNaming = config.getConstraintNaming();
this.historySuffix = config.getHistoryTableSuffix();
} }
@Override @Override
@@ -95,11 +89,6 @@ public class HanaHistoryDdl implements PlatformHistoryDdl {
createWithHistory(writer, table); createWithHistory(writer, table);
} }
@Override
public boolean alterHistoryTables() {
return true;
}
@Override @Override
public void updateTriggers(DdlWrite writer, String tableName) { public void updateTriggers(DdlWrite writer, String tableName) {
DdlAlterTable alter = platformDdl.alterTable(writer, tableName); DdlAlterTable alter = platformDdl.alterTable(writer, tableName);
@@ -140,8 +129,5 @@ public class HanaHistoryDdl implements PlatformHistoryDdl {
apply.endOfStatement(); apply.endOfStatement();
} }
protected String historyTableName(String tableName) {
return constraintNaming.normaliseTable(tableName) + historySuffix;
}
} }
@@ -31,14 +31,6 @@ public interface PlatformHistoryDdl {
*/ */
void addHistoryTable(DdlWrite writer, AddHistoryTable addHistoryTable); 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. * 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) { default void updateTriggers(DdlWrite writer, String tableName) {
// nop // 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);
}
} }
@@ -107,4 +107,23 @@ public class PostgresHistoryDdl extends DbTriggerBasedHistoryDdl {
buffer.append(");").newLine(); 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";
}
} }
@@ -14,8 +14,10 @@ import org.junit.jupiter.api.Test;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@@ -60,35 +62,38 @@ public class DbMigrationTest extends BaseTestCase {
((ConnectionPool)server().dataSource()).offline(); ((ConnectionPool)server().dataSource()).offline();
((ConnectionPool)server().dataSource()).online(); ((ConnectionPool)server().dataSource()).online();
cleanup("migtest_ckey_assoc", cleanup("migtest_ckey_assoc",
"migtest_ckey_detail", "migtest_ckey_detail",
"migtest_ckey_parent", "migtest_ckey_parent",
"migtest_e_basic", "migtest_e_basic",
"migtest_e_enum", "migtest_e_enum",
"migtest_e_history", "migtest_e_history",
"migtest_e_history2", "migtest_e_history2",
"migtest_e_history3", "migtest_e_history3",
"migtest_e_history4", "migtest_e_history4",
"migtest_e_history5", "migtest_e_history5",
"migtest_e_history6", "migtest_e_history6",
"migtest_e_ref", "migtest_e_ref",
"migtest_e_softdelete", "migtest_e_softdelete",
"migtest_e_user", "migtest_e_user",
"migtest_fk_cascade", "migtest_fk_cascade",
"migtest_fk_cascade_one", "migtest_fk_cascade_one",
"migtest_fk_none", "migtest_fk_none",
"migtest_fk_none_via_join", "migtest_fk_none_via_join",
"migtest_fk_one", "migtest_fk_one",
"migtest_fk_set_null", "migtest_fk_set_null",
"migtest_mtm_c", "migtest_mtm_c",
"migtest_mtm_m", "migtest_mtm_m",
"migtest_mtm_m_phone_numbers", "migtest_mtm_m_phone_numbers",
"migtest_mtm_c_migtest_mtm_m", "migtest_mtm_c_migtest_mtm_m",
"migtest_mtm_m_migtest_mtm_c", "migtest_mtm_m_migtest_mtm_c",
"migtest_oto_child", "migtest_oto_child",
"migtest_oto_master", "migtest_oto_master",
"table", "`migtest_QuOtEd`",
"\"table\"", "migtest_QuOtEd",
"`table`"); "\"migtest_QuOtEd\"",
"table",
"\"table\"",
"`table`");
((ConnectionPool)server().dataSource()).offline(); ((ConnectionPool)server().dataSource()).offline();
((ConnectionPool)server().dataSource()).online(); ((ConnectionPool)server().dataSource()).online();
@@ -100,8 +105,17 @@ public class DbMigrationTest extends BaseTestCase {
runScript("I__create_tablespaces.sql"); 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"); 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()) { if (isClickHouse()) {
// ClickHouse does not support transactions, so we cannot do update statements // ClickHouse does not support transactions, so we cannot do update statements
// Add column is also not implemented. So exit here // Add column is also not implemented. So exit here
@@ -164,7 +178,10 @@ public class DbMigrationTest extends BaseTestCase {
return; return;
} }
runScript("1.2__dropsFor_1.1.sql"); 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 // Oracle caches the statement and does not detect schema change. It fails with
// an ORA-01007 // an ORA-01007
result = server().sqlQuery("select * from migtest_e_basic order by id,status").findList(); 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);
server().script().runScript("cleanup", sb.toString(), true); server().script().runScript("cleanup", sb.toString(), true);
} }
private List<String> getTables() throws SQLException {
List<String> 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;
}
} }
@@ -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;
}
@@ -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;
}
@@ -105,6 +105,12 @@ create table migtest_e_history6 (
test_number2 UInt32 test_number2 UInt32
) ENGINE = Log(); ) ENGINE = Log();
create table "migtest_QuOtEd" (
id String,
status1 String,
status2 String
) ENGINE = Log();
create table migtest_e_ref ( create table migtest_e_ref (
id UInt32, id UInt32,
name String name String
@@ -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_string1;
alter table migtest_e_history2 drop column obsolete_string2; alter table migtest_e_history2 drop column obsolete_string2;
-- apply post alter -- apply post alter
drop table if exists "migtest_QuOtEd";
drop table if exists migtest_e_ref; drop table if exists migtest_e_ref;
@@ -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_basic drop constraint uq_migtest_e_basic_indextest5;
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status; alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
-- apply changes -- apply changes
create table "migtest_QuOtEd" (
id String,
status1 String,
status2 String
) ENGINE = Log();
create table migtest_e_ref ( create table migtest_e_ref (
id UInt32, id UInt32,
name String name String
@@ -1,6 +1,6 @@
863321871, 1.0__initial.sql 235371332, 1.0__initial.sql
1903846331, 1.1.sql 1903846331, 1.1.sql
1279151426, 1.2__dropsFor_1.1.sql 688811494, 1.2__dropsFor_1.1.sql
1630693278, 1.3.sql 1015552567, 1.3.sql
80209848, 1.4__dropsFor_1.3.sql 80209848, 1.4__dropsFor_1.3.sql
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id) 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 ( create table migtest_e_ref (
id integer generated by default as identity not null, id integer generated by default as identity not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); 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"); create index ix_table_from on "table" ("from");
@@ -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; 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_indextest1;
drop index if exists ix_migtest_e_basic_indextest5; drop index if exists ix_migtest_e_basic_indextest5;
drop index if exists ix_migtest_quoted_status1;
-- apply changes -- apply changes
create table migtest_e_user ( create table migtest_e_user (
id integer generated by default as identity not null, id integer generated by default as identity not null,
@@ -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_string1;
alter table migtest_e_history2 drop column obsolete_string2; alter table migtest_e_history2 drop column obsolete_string2;
-- apply post alter -- apply post alter
drop table if exists "migtest_QuOtEd" cascade;
drop table if exists migtest_e_ref cascade; drop table if exists migtest_e_ref cascade;
drop sequence if exists migtest_e_ref_seq; drop sequence if exists migtest_e_ref_seq;
@@ -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_indextest3;
drop index if exists ix_migtest_e_basic_indextest6; drop index if exists ix_migtest_e_basic_indextest6;
-- apply changes -- 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 ( create table migtest_e_ref (
id integer generated by default as identity not null, id integer generated by default as identity not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
@@ -1,7 +1,7 @@
1636200128, 1.0__initial.sql -703764770, 1.0__initial.sql
356413151, 1.1.sql 751308758, 1.1.sql
240919209, 1.2__dropsFor_1.1.sql 856096334, 1.2__dropsFor_1.1.sql
-430000356, 1.3.sql 17665322, 1.3.sql
-820814009, 1.4__dropsFor_1.3.sql -820814009, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql 561281075, R__order_views.sql
@@ -125,6 +125,15 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id) 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 ( create table migtest_e_ref (
id integer generated by default as identity not null, id integer generated by default as identity not null,
name varchar(127) 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; 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; 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; 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); 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_to on "table"("to") exclude null keys;
create unique index uq_table_varchar on "table"("varchar") 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); 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"); create index ix_table_from on "table" ("from");
@@ -2,81 +2,88 @@
-- drop dependencies -- drop dependencies
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest2';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_indextest2';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_indextest6';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index ix_migtest_e_basic_indextest1';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index ix_migtest_e_basic_indextest5';
execute stmt; execute stmt;
end if; end if;
end$$; 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 -- apply changes
create table migtest_e_user ( create table migtest_e_user (
id integer generated by default as identity not null, id integer generated by default as identity not null,
@@ -15,10 +15,11 @@ alter table migtest_e_history2_history drop column obsolete_string2;
call sysproc.admin_cmd('reorg table migtest_e_history2_history'); call sysproc.admin_cmd('reorg table migtest_e_history2_history');
-- apply post alter -- apply post alter
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history; alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
drop table "migtest_QuOtEd";
drop table migtest_e_ref; drop table migtest_e_ref;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop sequence migtest_e_ref_seq';
execute stmt; execute stmt;
end if; end if;
@@ -2,152 +2,161 @@
-- drop dependencies -- drop dependencies
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_ckey_detail drop constraint fk_migtest_ckey_detail_parent';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_none drop constraint fk_migtest_fk_none_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_none_via_join drop constraint fk_migtest_fk_none_via_join_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_description';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_description';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint fk_migtest_e_basic_user_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_status_indextest1';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_status_indextest1';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_name';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_name';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_indextest4';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_indextest5';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index ix_migtest_e_basic_indextest3';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index ix_migtest_e_basic_indextest6';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
-- apply changes -- 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 ( create table migtest_e_ref (
id integer generated by default as identity not null, id integer generated by default as identity not null,
name varchar(127) 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; alter table migtest_e_history6_history alter column test_number2 set not null;
call sysproc.admin_cmd('reorg table migtest_e_history6_history'); call sysproc.admin_cmd('reorg table migtest_e_history6_history');
-- apply post alter -- 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_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_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')); 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
@@ -43,7 +43,7 @@ alter table migtest_e_history5 add versioning use history table migtest_e_histor
drop table migtest_e_user; drop table migtest_e_user;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop sequence migtest_e_user_seq';
execute stmt; execute stmt;
end if; end if;
@@ -125,6 +125,15 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id) 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 ( create table migtest_e_ref (
id integer generated by default as identity not null, id integer generated by default as identity not null,
name varchar(127) 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; 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; 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; 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); 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_to on "table"("to") exclude null keys;
create unique index uq_table_varchar on "table"("varchar") 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_eu8csq on migtest_e_basic (indextest1);
create index ix_mgtst__b_eu8csu on migtest_e_basic (indextest5); 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"); create index ix_table_from on "table" ("from");
@@ -2,81 +2,88 @@
-- drop dependencies -- drop dependencies
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_mgtst_fk_65kf6l';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_mgtst_fk_wicx8x';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint ck_mgtst__bsc_stts';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint ck_mgtst__b_z543fg';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_4aybzy';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_mgtst__b_4aybzy';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_4ayc02';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_mgtst__b_4ayc02';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_enum drop constraint ck_mgtst__n_773sok';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index ix_mgtst__b_eu8csq';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index ix_mgtst__b_eu8csu';
execute stmt; execute stmt;
end if; end if;
end$$; 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 -- apply changes
create table migtest_e_user ( create table migtest_e_user (
id integer generated by default as identity not null, id integer generated by default as identity not null,
@@ -15,10 +15,11 @@ alter table migtest_e_history2_history drop column obsolete_string2;
call sysproc.admin_cmd('reorg table migtest_e_history2_history'); call sysproc.admin_cmd('reorg table migtest_e_history2_history');
-- apply post alter -- apply post alter
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history; alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
drop table "migtest_QuOtEd";
drop table migtest_e_ref; drop table migtest_e_ref;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop sequence migtest_e_ref_seq';
execute stmt; execute stmt;
end if; end if;
@@ -2,152 +2,161 @@
-- drop dependencies -- drop dependencies
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_ckey_detail drop constraint fk_mgtst_ck_e1qkb5';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_mgtst_fk_65kf6l';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_none drop constraint fk_mgtst_fk_nn_n_d';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_none_via_join drop constraint fk_mgtst_fk_9tknzj';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_mgtst_fk_wicx8x';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint ck_mgtst__bsc_stts';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint ck_mgtst__b_z543fg';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_vs45xo';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_mgtst__b_vs45xo';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint fk_mgtst__bsc_sr_d';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_ucfcne';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_mgtst__b_ucfcne';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__bsc_nm';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_mgtst__bsc_nm';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_4ayc00';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_mgtst__b_4ayc00';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_4ayc01';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_mgtst__b_4ayc01';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_enum drop constraint ck_mgtst__n_773sok';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index ix_mgtst__b_eu8css';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index ix_mgtst__b_eu8csv';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
-- apply changes -- 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 ( create table migtest_e_ref (
id integer generated by default as identity not null, id integer generated by default as identity not null,
name varchar(127) 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; alter table migtest_e_history6_history alter column test_number2 set not null;
call sysproc.admin_cmd('reorg table migtest_e_history6_history'); call sysproc.admin_cmd('reorg table migtest_e_history6_history');
-- apply post alter -- 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_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__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')); 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_eu8csq on migtest_e_basic (indextest1);
create index ix_mgtst__b_eu8csu on migtest_e_basic (indextest5); create index ix_mgtst__b_eu8csu on migtest_e_basic (indextest5);
create index ix_mgtst_qtd_stts1 on "migtest_QuOtEd" (status1);
@@ -43,7 +43,7 @@ alter table migtest_e_history5 add versioning use history table migtest_e_histor
drop table migtest_e_user; drop table migtest_e_user;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop sequence migtest_e_user_seq';
execute stmt; execute stmt;
end if; end if;
@@ -125,6 +125,15 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id) 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 ( create table migtest_e_ref (
id integer generated by default as identity not null, id integer generated by default as identity not null,
name varchar(127) 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; 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; 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; 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); 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_to on "table"("to") exclude null keys;
create unique index uq_table_varchar on "table"("varchar") 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); 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"); create index ix_table_from on "table" ("from");
@@ -2,81 +2,88 @@
-- drop dependencies -- drop dependencies
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest2';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_indextest2';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_indextest6';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index ix_migtest_e_basic_indextest1';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index ix_migtest_e_basic_indextest5';
execute stmt; execute stmt;
end if; end if;
end$$; 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 -- apply changes
create table migtest_e_user ( create table migtest_e_user (
id integer generated by default as identity not null, id integer generated by default as identity not null,
@@ -15,10 +15,11 @@ alter table migtest_e_history2_history drop column obsolete_string2;
call sysproc.admin_cmd('reorg table migtest_e_history2_history'); call sysproc.admin_cmd('reorg table migtest_e_history2_history');
-- apply post alter -- apply post alter
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history; alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
drop table "migtest_QuOtEd";
drop table migtest_e_ref; drop table migtest_e_ref;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop sequence migtest_e_ref_seq';
execute stmt; execute stmt;
end if; end if;
@@ -2,152 +2,161 @@
-- drop dependencies -- drop dependencies
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_ckey_detail drop constraint fk_migtest_ckey_detail_parent';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_none drop constraint fk_migtest_fk_none_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_none_via_join drop constraint fk_migtest_fk_none_via_join_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_description';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_description';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint fk_migtest_e_basic_user_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_status_indextest1';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_status_indextest1';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_name';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_name';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_indextest4';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_indextest5';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index ix_migtest_e_basic_indextest3';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index ix_migtest_e_basic_indextest6';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
-- apply changes -- 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 ( create table migtest_e_ref (
id integer generated by default as identity not null, id integer generated by default as identity not null,
name varchar(127) 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; alter table migtest_e_history6_history alter column test_number2 set not null;
call sysproc.admin_cmd('reorg table migtest_e_history6_history'); call sysproc.admin_cmd('reorg table migtest_e_history6_history');
-- apply post alter -- 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_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_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')); 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
@@ -43,7 +43,7 @@ alter table migtest_e_history5 add versioning use history table migtest_e_histor
drop table migtest_e_user; drop table migtest_e_user;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop sequence migtest_e_user_seq';
execute stmt; execute stmt;
end if; end if;
@@ -125,6 +125,15 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id) 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 ( create table migtest_e_ref (
id integer generated by default as identity not null, id integer generated by default as identity not null,
name varchar(127) 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; 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; 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; 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); 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_to on "table"("to") exclude null keys;
create unique index uq_table_varchar on "table"("varchar") 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); 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"); create index ix_table_from on "table" ("from");
@@ -2,81 +2,88 @@
-- drop dependencies -- drop dependencies
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest2';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_indextest2';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_indextest6';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index ix_migtest_e_basic_indextest1';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index ix_migtest_e_basic_indextest5';
execute stmt; execute stmt;
end if; end if;
end$$; 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 -- apply changes
create table migtest_e_user ( create table migtest_e_user (
id integer generated by default as identity not null, id integer generated by default as identity not null,
@@ -15,10 +15,11 @@ alter table migtest_e_history2_history drop column obsolete_string2;
call sysproc.admin_cmd('reorg table migtest_e_history2_history'); call sysproc.admin_cmd('reorg table migtest_e_history2_history');
-- apply post alter -- apply post alter
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history; alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
drop table "migtest_QuOtEd";
drop table migtest_e_ref; drop table migtest_e_ref;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop sequence migtest_e_ref_seq';
execute stmt; execute stmt;
end if; end if;
@@ -2,152 +2,161 @@
-- drop dependencies -- drop dependencies
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_ckey_detail drop constraint fk_migtest_ckey_detail_parent';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_none drop constraint fk_migtest_fk_none_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_none_via_join drop constraint fk_migtest_fk_none_via_join_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_description';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_description';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint fk_migtest_e_basic_user_id';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_status_indextest1';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_status_indextest1';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_name';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_name';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_indextest4';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5';
execute stmt; execute stmt;
end if; end if;
end$$ end$$
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index uq_migtest_e_basic_indextest5';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index ix_migtest_e_basic_indextest3';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop index ix_migtest_e_basic_indextest6';
execute stmt; execute stmt;
end if; end if;
end$$; end$$;
-- apply changes -- 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 ( create table migtest_e_ref (
id integer generated by default as identity not null, id integer generated by default as identity not null,
name varchar(127) 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; alter table migtest_e_history6_history alter column test_number2 set not null;
call sysproc.admin_cmd('reorg table migtest_e_history6_history'); call sysproc.admin_cmd('reorg table migtest_e_history6_history');
-- apply post alter -- 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_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_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')); 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
@@ -43,7 +43,7 @@ alter table migtest_e_history5 add versioning use history table migtest_e_histor
drop table migtest_e_user; drop table migtest_e_user;
delimiter $$ delimiter $$
begin 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'; prepare stmt from 'drop sequence migtest_e_user_seq';
execute stmt; execute stmt;
end if; end if;
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id) 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 ( create table migtest_e_ref (
id integer auto_increment not null, id integer auto_increment not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); 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"); create index ix_table_from on "table" ("from");
@@ -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; 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_indextest1;
drop index if exists ix_migtest_e_basic_indextest5; drop index if exists ix_migtest_e_basic_indextest5;
drop index if exists ix_migtest_quoted_status1;
-- apply changes -- apply changes
create table migtest_e_user ( create table migtest_e_user (
id integer auto_increment not null, id integer auto_increment not null,
@@ -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_string1;
alter table migtest_e_history2 drop column obsolete_string2; alter table migtest_e_history2 drop column obsolete_string2;
-- apply post alter -- apply post alter
drop table if exists "migtest_QuOtEd";
drop table if exists migtest_e_ref; drop table if exists migtest_e_ref;
@@ -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_indextest3;
drop index if exists ix_migtest_e_basic_indextest6; drop index if exists ix_migtest_e_basic_indextest6;
-- apply changes -- 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 ( create table migtest_e_ref (
id integer auto_increment not null, id integer auto_increment not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
@@ -1,6 +1,6 @@
-1347475412, 1.0__initial.sql -710189690, 1.0__initial.sql
2132717520, 1.1.sql 1626063176, 1.1.sql
1279151426, 1.2__dropsFor_1.1.sql 688811494, 1.2__dropsFor_1.1.sql
-796269364, 1.3.sql 2025934113, 1.3.sql
80209848, 1.4__dropsFor_1.3.sql 80209848, 1.4__dropsFor_1.3.sql
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id) 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 ( create table migtest_e_ref (
id integer generated by default as identity not null, id integer generated by default as identity not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); 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"); create index ix_table_from on "table" ("from");
@@ -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; 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_indextest1;
drop index if exists ix_migtest_e_basic_indextest5; drop index if exists ix_migtest_e_basic_indextest5;
drop index if exists ix_migtest_quoted_status1;
-- apply changes -- apply changes
create table migtest_e_user ( create table migtest_e_user (
id integer generated by default as identity not null, id integer generated by default as identity not null,
@@ -14,5 +14,6 @@ alter table migtest_e_history2_history drop column obsolete_string2;
-- apply post alter -- 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 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"; 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 table if exists migtest_e_ref;
drop sequence if exists migtest_e_ref_seq; drop sequence if exists migtest_e_ref_seq;
@@ -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_indextest3;
drop index if exists ix_migtest_e_basic_indextest6; drop index if exists ix_migtest_e_basic_indextest6;
-- apply changes -- 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 ( create table migtest_e_ref (
id integer generated by default as identity not null, id integer generated by default as identity not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
@@ -1,7 +1,7 @@
-1179806373, 1.0__initial.sql -1826073043, 1.0__initial.sql
398205555, 1.1.sql -132538485, 1.1.sql
-1366392410, 1.2__dropsFor_1.1.sql -2064267391, 1.2__dropsFor_1.1.sql
-523874424, 1.3.sql -94686510, 1.3.sql
-1382108238, 1.4__dropsFor_1.3.sql -1382108238, 1.4__dropsFor_1.3.sql
783227075, R__multi_comments.sql 783227075, R__multi_comments.sql
561281075, R__order_views.sql 561281075, R__order_views.sql
@@ -127,6 +127,16 @@ create column table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id) 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 ( create column table migtest_e_ref (
id integer generated by default as identity not null, id integer generated by default as identity not null,
name nvarchar(127) 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_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_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; -- explicit index "ix_table_from" for single column ""from"" of table ""table"" is not necessary;
@@ -51,6 +51,13 @@ declare exit handler for sql_error_code 261 begin end;
exec 'drop index ix_migtest_e_basic_indextest5'; exec 'drop index ix_migtest_e_basic_indextest5';
end; end;
$$; $$;
delimiter $$
do
begin
declare exit handler for sql_error_code 261 begin end;
exec 'drop index ix_migtest_quoted_status1';
end;
$$;
-- apply changes -- apply changes
create column table migtest_e_user ( create column table migtest_e_user (
id integer generated by default as identity not null, id integer generated by default as identity not null,
@@ -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'); CALL usp_ebean_drop_column('migtest_e_history2_history', 'obsolete_string2');
-- apply post alter -- apply post alter
alter table migtest_e_history2 add system versioning history table migtest_e_history2_history not validated; 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; drop table migtest_e_ref cascade;
@@ -77,6 +77,16 @@ exec 'drop index ix_migtest_e_basic_indextest6';
end; end;
$$; $$;
-- apply changes -- 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 ( create column table migtest_e_ref (
id integer generated by default as identity not null, id integer generated by default as identity not null,
name nvarchar(127) 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_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_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;
@@ -1,8 +1,8 @@
-745347271, I__create_procs.sql -745347271, I__create_procs.sql
1934891896, 1.0__initial.sql 1631114894, 1.0__initial.sql
187688059, 1.1.sql -1483493637, 1.1.sql
197547825, 1.2__dropsFor_1.1.sql 1535221752, 1.2__dropsFor_1.1.sql
-1989736027, 1.3.sql 483907844, 1.3.sql
1812245353, 1.4__dropsFor_1.3.sql 1812245353, 1.4__dropsFor_1.3.sql
1906063401, R__order_views_hana.sql 1906063401, R__order_views_hana.sql
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id) 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 ( create table migtest_e_ref (
id integer generated by default as identity (start with 1) not null, id integer generated by default as identity (start with 1) not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); 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"); create index ix_table_from on "table" ("from");
@@ -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; 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_indextest1;
drop index if exists ix_migtest_e_basic_indextest5; drop index if exists ix_migtest_e_basic_indextest5;
drop index if exists ix_migtest_quoted_status1;
-- apply changes -- apply changes
create table migtest_e_user ( create table migtest_e_user (
id integer generated by default as identity (start with 1) not null, id integer generated by default as identity (start with 1) not null,
@@ -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_string1;
alter table migtest_e_history2 drop column obsolete_string2; alter table migtest_e_history2 drop column obsolete_string2;
-- apply post alter -- apply post alter
drop table if exists "migtest_QuOtEd";
drop table if exists migtest_e_ref; drop table if exists migtest_e_ref;
drop sequence if exists migtest_e_ref_seq; drop sequence if exists migtest_e_ref_seq;
@@ -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_indextest3;
drop index if exists ix_migtest_e_basic_indextest6; drop index if exists ix_migtest_e_basic_indextest6;
-- apply changes -- 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 ( create table migtest_e_ref (
id integer generated by default as identity (start with 1) not null, id integer generated by default as identity (start with 1) not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
@@ -1,7 +1,7 @@
-917796012, 1.0__initial.sql -906026927, 1.0__initial.sql
-838725141, 1.1.sql 135699844, 1.1.sql
-300925212, 1.2__dropsFor_1.1.sql -848622216, 1.2__dropsFor_1.1.sql
-1549893170, 1.3.sql 781720387, 1.3.sql
-972999284, 1.4__dropsFor_1.3.sql -972999284, 1.4__dropsFor_1.3.sql
861001272, R__order_views_hsqldb.sql 861001272, R__order_views_hsqldb.sql
@@ -124,6 +124,14 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id) 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 ( create table migtest_e_ref (
id integer auto_increment not null, id integer auto_increment not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); 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`); create index ix_table_from on `table` (`from`);
@@ -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; 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_indextest1 on migtest_e_basic;
drop index ix_migtest_e_basic_indextest5 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 -- apply changes
create table migtest_e_user ( create table migtest_e_user (
id integer auto_increment not null, id integer auto_increment not null,
@@ -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_string1;
alter table migtest_e_history2 drop column obsolete_string2; alter table migtest_e_history2 drop column obsolete_string2;
-- apply post alter -- apply post alter
drop table if exists `migtest_QuOtEd`;
drop table if exists migtest_e_ref; drop table if exists migtest_e_ref;
drop sequence if exists migtest_e_ref_seq; drop sequence if exists migtest_e_ref_seq;
@@ -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_indextest3 on migtest_e_basic;
drop index ix_migtest_e_basic_indextest6 on migtest_e_basic; drop index ix_migtest_e_basic_indextest6 on migtest_e_basic;
-- apply changes -- 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 ( create table migtest_e_ref (
id integer auto_increment not null, id integer auto_increment not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
@@ -1,7 +1,7 @@
675320779, 1.0__initial.sql 168258180, 1.0__initial.sql
840323734, 1.1.sql -1449201260, 1.1.sql
-828985759, 1.2__dropsFor_1.1.sql 919151678, 1.2__dropsFor_1.1.sql
-1470028617, 1.3.sql -1031408459, 1.3.sql
-446860935, 1.4__dropsFor_1.3.sql -446860935, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql 561281075, R__order_views.sql
@@ -124,6 +124,14 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id) 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 ( create table migtest_e_ref (
id integer auto_increment not null, id integer auto_increment not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); 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`); create index ix_table_from on `table` (`from`);
@@ -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; 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_indextest1 on migtest_e_basic;
drop index ix_migtest_e_basic_indextest5 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 -- apply changes
create table migtest_e_user ( create table migtest_e_user (
id integer auto_increment not null, id integer auto_increment not null,
@@ -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_string1');
CALL usp_ebean_drop_column('migtest_e_history2', 'obsolete_string2'); CALL usp_ebean_drop_column('migtest_e_history2', 'obsolete_string2');
-- apply post alter -- apply post alter
drop table if exists `migtest_QuOtEd`;
drop table if exists migtest_e_ref; drop table if exists migtest_e_ref;
drop sequence if exists migtest_e_ref_seq; drop sequence if exists migtest_e_ref_seq;
@@ -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_indextest3 on migtest_e_basic;
drop index ix_migtest_e_basic_indextest6 on migtest_e_basic; drop index ix_migtest_e_basic_indextest6 on migtest_e_basic;
-- apply changes -- 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 ( create table migtest_e_ref (
id integer auto_increment not null, id integer auto_increment not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
@@ -1,8 +1,8 @@
1835064798, I__create_procs.sql 1835064798, I__create_procs.sql
675320779, 1.0__initial.sql 168258180, 1.0__initial.sql
840323734, 1.1.sql -1449201260, 1.1.sql
2123392915, 1.2__dropsFor_1.1.sql 1187950993, 1.2__dropsFor_1.1.sql
-1470028617, 1.3.sql -1031408459, 1.3.sql
-692020559, 1.4__dropsFor_1.3.sql -692020559, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql 561281075, R__order_views.sql
@@ -91,6 +91,12 @@
<column name="test_number1" type="integer"/> <column name="test_number1" type="integer"/>
<column name="test_number2" type="integer" notnull="true"/> <column name="test_number2" type="integer" notnull="true"/>
</createTable> </createTable>
<createTable name="&quot;migtest_QuOtEd&quot;" identityType="external" pkName="pk_migtest_quoted">
<column name="id" type="varchar" primaryKey="true"/>
<column name="status1" type="varchar(1)" checkConstraint="check ( status1 in ('N','A','I'))" checkConstraintName="ck_migtest_quoted_status1"/>
<column name="status2" type="varchar(1)" checkConstraint="check ( status2 in ('N','A','I'))" checkConstraintName="ck_migtest_quoted_status2"/>
<uniqueConstraint name="uq_migtest_quoted_status2" columnNames="status2" oneToOne="false" nullableColumns="status2"/>
</createTable>
<createTable name="migtest_e_ref" pkName="pk_migtest_e_ref"> <createTable name="migtest_e_ref" pkName="pk_migtest_e_ref">
<column name="id" type="integer" primaryKey="true"/> <column name="id" type="integer" primaryKey="true"/>
<column name="name" type="varchar(127)" notnull="true"/> <column name="name" type="varchar(127)" notnull="true"/>
@@ -127,6 +133,7 @@
</createTable> </createTable>
<createIndex indexName="ix_migtest_e_basic_indextest1" tableName="migtest_e_basic" columns="indextest1"/> <createIndex indexName="ix_migtest_e_basic_indextest1" tableName="migtest_e_basic" columns="indextest1"/>
<createIndex indexName="ix_migtest_e_basic_indextest5" tableName="migtest_e_basic" columns="indextest5"/> <createIndex indexName="ix_migtest_e_basic_indextest5" tableName="migtest_e_basic" columns="indextest5"/>
<createIndex indexName="ix_migtest_quoted_status1" tableName="&quot;migtest_QuOtEd&quot;" columns="status1"/>
<createIndex indexName="ix_table_from" tableName="&quot;table&quot;" columns="&quot;from&quot;"/> <createIndex indexName="ix_table_from" tableName="&quot;table&quot;" columns="&quot;from&quot;"/>
<createIndex indexName="idxd_migtest_0" tableName="migtest_oto_child" columns="" definition="create index idxd_migtest_0 on migtest_oto_child using hash (upper(name)) where upper(name) = 'JIM'" platforms="POSTGRES"/> <createIndex indexName="idxd_migtest_0" tableName="migtest_oto_child" columns="" definition="create index idxd_migtest_0 on migtest_oto_child using hash (upper(name)) where upper(name) = 'JIM'" platforms="POSTGRES"/>
<createIndex indexName="ix_migtest_oto_child_lowername_id" tableName="migtest_oto_child" columns="lower(name),id" concurrent="true" platforms="POSTGRES"/> <createIndex indexName="ix_migtest_oto_child_lowername_id" tableName="migtest_oto_child" columns="lower(name),id" concurrent="true" platforms="POSTGRES"/>
@@ -106,6 +106,7 @@
<createIndex indexName="ix_migtest_oto_child_name" tableName="migtest_oto_child" columns="name" platforms="POSTGRES"/> <createIndex indexName="ix_migtest_oto_child_name" tableName="migtest_oto_child" columns="name" platforms="POSTGRES"/>
<dropIndex indexName="ix_migtest_e_basic_indextest1" tableName="migtest_e_basic"/> <dropIndex indexName="ix_migtest_e_basic_indextest1" tableName="migtest_e_basic"/>
<dropIndex indexName="ix_migtest_e_basic_indextest5" tableName="migtest_e_basic"/> <dropIndex indexName="ix_migtest_e_basic_indextest5" tableName="migtest_e_basic"/>
<dropIndex indexName="ix_migtest_quoted_status1" tableName="&quot;migtest_QuOtEd&quot;"/>
<dropIndex indexName="idxd_migtest_0" tableName="migtest_oto_child" platforms="POSTGRES"/> <dropIndex indexName="idxd_migtest_0" tableName="migtest_oto_child" platforms="POSTGRES"/>
<dropIndex indexName="ix_migtest_oto_child_lowername_id" tableName="migtest_oto_child" concurrent="true" platforms="POSTGRES"/> <dropIndex indexName="ix_migtest_oto_child_lowername_id" tableName="migtest_oto_child" concurrent="true" platforms="POSTGRES"/>
<dropIndex indexName="ix_migtest_oto_child_lowername" tableName="migtest_oto_child" platforms="POSTGRES"/> <dropIndex indexName="ix_migtest_oto_child_lowername" tableName="migtest_oto_child" platforms="POSTGRES"/>
@@ -117,6 +118,7 @@
<dropColumn columnName="eref_id" tableName="migtest_e_basic"/> <dropColumn columnName="eref_id" tableName="migtest_e_basic"/>
<dropColumn columnName="obsolete_string1" tableName="migtest_e_history2" withHistory="true"/> <dropColumn columnName="obsolete_string1" tableName="migtest_e_history2" withHistory="true"/>
<dropColumn columnName="obsolete_string2" tableName="migtest_e_history2" withHistory="true"/> <dropColumn columnName="obsolete_string2" tableName="migtest_e_history2" withHistory="true"/>
<dropTable name="&quot;migtest_QuOtEd&quot;"/>
<dropTable name="migtest_e_ref" sequenceCol="id"/> <dropTable name="migtest_e_ref" sequenceCol="id"/>
</changeSet> </changeSet>
</migration> </migration>
@@ -7,6 +7,7 @@
<dropColumn columnName="eref_id" tableName="migtest_e_basic"/> <dropColumn columnName="eref_id" tableName="migtest_e_basic"/>
<dropColumn columnName="obsolete_string1" tableName="migtest_e_history2" withHistory="true"/> <dropColumn columnName="obsolete_string1" tableName="migtest_e_history2" withHistory="true"/>
<dropColumn columnName="obsolete_string2" tableName="migtest_e_history2" withHistory="true"/> <dropColumn columnName="obsolete_string2" tableName="migtest_e_history2" withHistory="true"/>
<dropTable name="&quot;migtest_QuOtEd&quot;"/>
<dropTable name="migtest_e_ref" sequenceCol="id"/> <dropTable name="migtest_e_ref" sequenceCol="id"/>
</changeSet> </changeSet>
</migration> </migration>
@@ -35,6 +35,12 @@
<alterColumn columnName="test_number" tableName="migtest_e_history4" withHistory="true" type="integer" currentType="bigint" currentNotnull="false"/> <alterColumn columnName="test_number" tableName="migtest_e_history4" withHistory="true" type="integer" currentType="bigint" currentNotnull="false"/>
<alterColumn columnName="test_number1" tableName="migtest_e_history6" withHistory="true" currentType="integer" defaultValue="DROP DEFAULT" notnull="false" currentNotnull="true"/> <alterColumn columnName="test_number1" tableName="migtest_e_history6" withHistory="true" currentType="integer" defaultValue="DROP DEFAULT" notnull="false" currentNotnull="true"/>
<alterColumn columnName="test_number2" tableName="migtest_e_history6" withHistory="true" currentType="integer" defaultValue="7" notnull="true" currentNotnull="false"/> <alterColumn columnName="test_number2" tableName="migtest_e_history6" withHistory="true" currentType="integer" defaultValue="7" notnull="true" currentNotnull="false"/>
<createTable name="&quot;migtest_QuOtEd&quot;" identityType="external" pkName="pk_migtest_quoted">
<column name="id" type="varchar" primaryKey="true"/>
<column name="status1" type="varchar(1)" checkConstraint="check ( status1 in ('N','A','I'))" checkConstraintName="ck_migtest_quoted_status1"/>
<column name="status2" type="varchar(1)" checkConstraint="check ( status2 in ('N','A','I'))" checkConstraintName="ck_migtest_quoted_status2"/>
<uniqueConstraint name="uq_migtest_quoted_status2" columnNames="status2" oneToOne="false" nullableColumns="status2"/>
</createTable>
<createTable name="migtest_e_ref" pkName="pk_migtest_e_ref"> <createTable name="migtest_e_ref" pkName="pk_migtest_e_ref">
<column name="id" type="integer" primaryKey="true"/> <column name="id" type="integer" primaryKey="true"/>
<column name="name" type="varchar(127)" notnull="true"/> <column name="name" type="varchar(127)" notnull="true"/>
@@ -47,6 +53,7 @@
<addUniqueConstraint constraintName="uq_migtest_oto_master_name" tableName="migtest_oto_master" columnNames="name" oneToOne="false" nullableColumns="name" platforms="MYSQL"/> <addUniqueConstraint constraintName="uq_migtest_oto_master_name" tableName="migtest_oto_master" columnNames="name" oneToOne="false" nullableColumns="name" platforms="MYSQL"/>
<createIndex indexName="ix_migtest_e_basic_indextest1" tableName="migtest_e_basic" columns="indextest1"/> <createIndex indexName="ix_migtest_e_basic_indextest1" tableName="migtest_e_basic" columns="indextest1"/>
<createIndex indexName="ix_migtest_e_basic_indextest5" tableName="migtest_e_basic" columns="indextest5"/> <createIndex indexName="ix_migtest_e_basic_indextest5" tableName="migtest_e_basic" columns="indextest5"/>
<createIndex indexName="ix_migtest_quoted_status1" tableName="&quot;migtest_QuOtEd&quot;" columns="status1"/>
<createIndex indexName="ix_m12_otoc71" tableName="migtest_oto_child" columns="name" platforms="POSTGRES"/> <createIndex indexName="ix_m12_otoc71" tableName="migtest_oto_child" columns="name" platforms="POSTGRES"/>
<createIndex indexName="ix_m12_otoc72" tableName="migtest_oto_child" columns="name" platforms="MYSQL"/> <createIndex indexName="ix_m12_otoc72" tableName="migtest_oto_child" columns="name" platforms="MYSQL"/>
<createIndex indexName="uq_m12_otoc71" tableName="migtest_oto_child" columns="lower(name)" unique="true" platforms="POSTGRES"/> <createIndex indexName="uq_m12_otoc71" tableName="migtest_oto_child" columns="lower(name)" unique="true" platforms="POSTGRES"/>
@@ -124,6 +124,14 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id) 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 ( create table migtest_e_ref (
id integer auto_increment not null, id integer auto_increment not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); 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`); create index ix_table_from on `table` (`from`);
@@ -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; 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_indextest1 on migtest_e_basic;
drop index ix_migtest_e_basic_indextest5 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 -- apply changes
create table migtest_e_user ( create table migtest_e_user (
id integer auto_increment not null, id integer auto_increment not null,
@@ -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); 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$$ end$$
unlock tables; unlock tables;
drop table if exists `migtest_QuOtEd`;
drop table if exists migtest_e_ref; drop table if exists migtest_e_ref;
@@ -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_indextest3 on migtest_e_basic;
drop index ix_migtest_e_basic_indextest6 on migtest_e_basic; drop index ix_migtest_e_basic_indextest6 on migtest_e_basic;
-- apply changes -- 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 ( create table migtest_e_ref (
id integer auto_increment not null, id integer auto_increment not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); 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_m12_otoc72 on migtest_oto_child (name);
create index ix_migtest_oto_master_name on migtest_oto_master (name); create index ix_migtest_oto_master_name on migtest_oto_master (name);
@@ -1,8 +1,8 @@
1835064798, I__create_procs.sql 1835064798, I__create_procs.sql
1464726622, 1.0__initial.sql -1894322966, 1.0__initial.sql
1321178229, 1.1.sql 718635669, 1.1.sql
-1332434945, 1.2__dropsFor_1.1.sql -1097227916, 1.2__dropsFor_1.1.sql
-105506677, 1.3.sql -1972055805, 1.3.sql
379252952, 1.4__dropsFor_1.3.sql 379252952, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql 561281075, R__order_views.sql
@@ -124,6 +124,14 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id) 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 ( create table migtest_e_ref (
id integer auto_increment not null, id integer auto_increment not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); 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`); create index ix_table_from on `table` (`from`);
@@ -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; 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_indextest1 on migtest_e_basic;
drop index ix_migtest_e_basic_indextest5 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 -- apply changes
create table migtest_e_user ( create table migtest_e_user (
id integer auto_increment not null, id integer auto_increment not null,
@@ -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); 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$$ end$$
unlock tables; unlock tables;
drop table if exists `migtest_QuOtEd`;
drop table if exists migtest_e_ref; drop table if exists migtest_e_ref;
@@ -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_indextest3 on migtest_e_basic;
drop index ix_migtest_e_basic_indextest6 on migtest_e_basic; drop index ix_migtest_e_basic_indextest6 on migtest_e_basic;
-- apply changes -- 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 ( create table migtest_e_ref (
id integer auto_increment not null, id integer auto_increment not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); 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_m12_otoc72 on migtest_oto_child (name);
create index ix_migtest_oto_master_name on migtest_oto_master (name); create index ix_migtest_oto_master_name on migtest_oto_master (name);
@@ -1,8 +1,8 @@
1835064798, I__create_procs.sql 1835064798, I__create_procs.sql
782176262, 1.0__initial.sql 955526296, 1.0__initial.sql
1321178229, 1.1.sql 718635669, 1.1.sql
-1332434945, 1.2__dropsFor_1.1.sql -1097227916, 1.2__dropsFor_1.1.sql
-105506677, 1.3.sql -1972055805, 1.3.sql
379252952, 1.4__dropsFor_1.3.sql 379252952, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql 561281075, R__order_views.sql
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id) 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 ( create table migtest_e_ref (
id integer generated by default as identity not null, id integer generated by default as identity not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); 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"); create index ix_table_from on "table" ("from");
@@ -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; 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_indextest1;
drop index if exists ix_migtest_e_basic_indextest5; drop index if exists ix_migtest_e_basic_indextest5;
drop index if exists ix_migtest_quoted_status1;
-- apply changes -- apply changes
create table migtest_e_user ( create table migtest_e_user (
id integer generated by default as identity not null, id integer generated by default as identity not null,
@@ -27,5 +27,6 @@ create or replace trigger migtest_e_history2_history_del for migtest_e_history2
end_trigger; end_trigger;
$$ $$
drop table if exists "migtest_QuOtEd";
drop table if exists migtest_e_ref; drop table if exists migtest_e_ref;
drop sequence if exists migtest_e_ref_seq; drop sequence if exists migtest_e_ref_seq;
@@ -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_indextest3;
drop index if exists ix_migtest_e_basic_indextest6; drop index if exists ix_migtest_e_basic_indextest6;
-- apply changes -- 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 ( create table migtest_e_ref (
id integer generated by default as identity not null, id integer generated by default as identity not null,
name varchar(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
@@ -1,7 +1,7 @@
-357978944, 1.0__initial.sql -355978970, 1.0__initial.sql
1244774121, 1.1.sql -1099441011, 1.1.sql
-424253630, 1.2__dropsFor_1.1.sql 1530685455, 1.2__dropsFor_1.1.sql
-1988156517, 1.3.sql 1263834751, 1.3.sql
-1189704269, 1.4__dropsFor_1.3.sql -1189704269, 1.4__dropsFor_1.3.sql
561281075, R__order_views.sql 561281075, R__order_views.sql
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
constraint pk_migtest_e_history6 primary key (id) 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 ( create table migtest_e_ref (
id number(10) generated by default as identity not null, id number(10) generated by default as identity not null,
name varchar2(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); 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"); create index ix_table_from on "table" ("from");
@@ -54,6 +54,7 @@ end;
$$; $$;
drop index ix_migtest_e_basic_indextest1; drop index ix_migtest_e_basic_indextest1;
drop index ix_migtest_e_basic_indextest5; drop index ix_migtest_e_basic_indextest5;
drop index ix_migtest_quoted_status1;
-- apply changes -- apply changes
create table migtest_e_user ( create table migtest_e_user (
id number(10) generated by default as identity not null, id number(10) generated by default as identity not null,
@@ -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_string1;
alter table migtest_e_history2 drop column obsolete_string2; alter table migtest_e_history2 drop column obsolete_string2;
-- apply post alter -- apply post alter
drop table "migtest_QuOtEd" cascade constraints purge;
drop table migtest_e_ref cascade constraints purge; drop table migtest_e_ref cascade constraints purge;
delimiter $$ delimiter $$
declare declare
@@ -89,6 +89,16 @@ $$;
drop index ix_migtest_e_basic_indextest3; drop index ix_migtest_e_basic_indextest3;
drop index ix_migtest_e_basic_indextest6; drop index ix_migtest_e_basic_indextest6;
-- apply changes -- 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 ( create table migtest_e_ref (
id number(10) generated by default as identity not null, id number(10) generated by default as identity not null,
name varchar2(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
@@ -1,7 +1,7 @@
-2071028889, 1.0__initial.sql 1374133214, 1.0__initial.sql
-1556388339, 1.1.sql -1429935878, 1.1.sql
-582436324, 1.2__dropsFor_1.1.sql 930172034, 1.2__dropsFor_1.1.sql
-712179623, 1.3.sql -1621367223, 1.3.sql
663051206, 1.4__dropsFor_1.3.sql 663051206, 1.4__dropsFor_1.3.sql
1357801733, R__oracle_only_views.sql 1357801733, R__oracle_only_views.sql
561281075, R__order_views.sql 561281075, R__order_views.sql
@@ -143,6 +143,16 @@ create table migtest_e_history6 (
); );
create sequence migtest_e_history6_seq; 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 ( create table migtest_e_ref (
id number(10) not null, id number(10) not null,
name varchar2(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); 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"); create index ix_table_from on "table" ("from");
@@ -54,6 +54,7 @@ end;
$$; $$;
drop index ix_migtest_e_basic_indextest1; drop index ix_migtest_e_basic_indextest1;
drop index ix_migtest_e_basic_indextest5; drop index ix_migtest_e_basic_indextest5;
drop index ix_migtest_quoted_status1;
-- apply changes -- apply changes
create table migtest_e_user ( create table migtest_e_user (
id number(10) not null, id number(10) not null,
@@ -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_string1;
alter table migtest_e_history2 drop column obsolete_string2; alter table migtest_e_history2 drop column obsolete_string2;
-- apply post alter -- apply post alter
drop table "migtest_QuOtEd" cascade constraints purge;
drop table migtest_e_ref cascade constraints purge; drop table migtest_e_ref cascade constraints purge;
delimiter $$ delimiter $$
declare declare
@@ -89,6 +89,16 @@ $$;
drop index ix_migtest_e_basic_indextest3; drop index ix_migtest_e_basic_indextest3;
drop index ix_migtest_e_basic_indextest6; drop index ix_migtest_e_basic_indextest6;
-- apply changes -- 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 ( create table migtest_e_ref (
id number(10) not null, id number(10) not null,
name varchar2(127) 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_indextest1 on migtest_e_basic (indextest1);
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5); create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
@@ -1,7 +1,7 @@
-1110489114, 1.0__initial.sql 1070168506, 1.0__initial.sql
1800537955, 1.1.sql 984602561, 1.1.sql
-582436324, 1.2__dropsFor_1.1.sql 930172034, 1.2__dropsFor_1.1.sql
-253819510, 1.3.sql -144959080, 1.3.sql
663051206, 1.4__dropsFor_1.3.sql 663051206, 1.4__dropsFor_1.3.sql
1357801733, R__oracle_only_views.sql 1357801733, R__oracle_only_views.sql
561281075, R__order_views.sql 561281075, R__order_views.sql
Loaded 100 of 135 files, more files were not shown because too many files have changed in this diff. Show more