mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Merge branch 'master' of github.com:ebean-orm/ebean
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
[](https://github.com/ebean-orm/ebean/blob/master/LICENSE)
|
||||
[](https://github.com/ebean-orm/ebean/actions/workflows/multi-jdk-build.yml)
|
||||
[](https://github.com/ebean-orm/ebean/actions/workflows/jdk-18-ea.yml)
|
||||
[](https://github.com/ebean-orm/ebean/actions/workflows/jdk-ea.yml)
|
||||
|
||||
[](https://github.com/ebean-orm/ebean/actions/workflows/h2database.yml)
|
||||
[](https://github.com/ebean-orm/ebean/actions/workflows/postgres.yml)
|
||||
@@ -12,6 +11,15 @@
|
||||
[](https://github.com/ebean-orm/ebean/actions/workflows/sqlserver.yml)
|
||||
[](https://github.com/ebean-orm/ebean/actions/workflows/yugabyte.yml)
|
||||
|
||||
|
||||
#### Builds against EA (Early Access) versions of Java (19, Loom, panama etc)
|
||||
|
||||
[](https://github.com/ebean-orm/ebean/actions/workflows/jdk-ea.yml)
|
||||
[](https://github.com/ebean-orm/ebean-datasource/actions/workflows/jdk-ea.yml)
|
||||
[](https://github.com/ebean-orm/ebean-migration/actions/workflows/jdk-ea.yml)
|
||||
[](https://github.com/ebean-orm/ebean-test-docker/actions/workflows/jdk-ea.yml)
|
||||
|
||||
|
||||
# Sponsors
|
||||
<table>
|
||||
<tbody>
|
||||
@@ -40,39 +48,15 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
# Need help?
|
||||
## Need help?
|
||||
Post questions or issues to the Ebean google group - https://groups.google.com/forum/#!forum/ebean
|
||||
|
||||
# Documentation
|
||||
## Documentation
|
||||
Goto [https://ebean.io/docs/](https://ebean.io/docs/)
|
||||
|
||||
|
||||
## Maven central links:
|
||||
[Maven central - ebean](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.ebean%22%20AND%20a%3A%22ebean%22 "maven central ebean")
|
||||
|
||||
[Maven central - all related projects](http://search.maven.org/#search%7Cga%7C1%7Cebean "maven central all related projects")
|
||||
## Maven central
|
||||
[Maven central - io.ebean](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.ebean%22%20)
|
||||
|
||||
|
||||
## Early access builds
|
||||
|
||||
<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>
|
||||
|
||||
+10
-19
@@ -4,7 +4,6 @@ import io.ebean.annotation.Platform;
|
||||
import io.ebean.config.DatabaseConfig;
|
||||
import io.ebean.config.DbConstraintNaming;
|
||||
import io.ebean.config.NamingConvention;
|
||||
import io.ebean.config.dbplatform.DbHistorySupport;
|
||||
import io.ebean.config.dbplatform.IdType;
|
||||
import io.ebean.util.StringHelper;
|
||||
import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer;
|
||||
@@ -62,7 +61,7 @@ public class BaseTableDdl implements TableDdl {
|
||||
|
||||
private final boolean strictMode;
|
||||
|
||||
private final boolean alterHistoryTables;
|
||||
private final PlatformHistoryDdl.TableBased tableHistory;
|
||||
|
||||
/**
|
||||
* Helper class that is used to execute the migration ddl before and after the migration action.
|
||||
@@ -181,11 +180,10 @@ public class BaseTableDdl implements TableDdl {
|
||||
this.platformDdl = platformDdl;
|
||||
this.platformDdl.configure(config);
|
||||
this.strictMode = config.isDdlStrictMode();
|
||||
DbHistorySupport hist = platformDdl.getPlatform().getHistorySupport();
|
||||
if (hist == null) {
|
||||
this.alterHistoryTables = false;
|
||||
if (platformDdl.historyDdl instanceof PlatformHistoryDdl.TableBased) {
|
||||
this.tableHistory = (PlatformHistoryDdl.TableBased) platformDdl.historyDdl;
|
||||
} else {
|
||||
this.alterHistoryTables = platformDdl.historyDdl.alterHistoryTables();
|
||||
this.tableHistory = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -634,8 +632,8 @@ public class BaseTableDdl implements TableDdl {
|
||||
if (isTrue(addColumn.isWithHistory())) {
|
||||
platformDdl.regenerateHistoryTriggers(writer, tableName);
|
||||
// make same changes to the history table
|
||||
if (alterHistoryTables) {
|
||||
String historyTable = historyTable(tableName);
|
||||
if (tableHistory != null) {
|
||||
String historyTable = tableHistory.historyTableName(tableName);
|
||||
for (Column column : columns) {
|
||||
alterTableAddColumn(writer, historyTable, column, true, true);
|
||||
}
|
||||
@@ -694,8 +692,8 @@ public class BaseTableDdl implements TableDdl {
|
||||
if (isTrue(dropColumn.isWithHistory())) {
|
||||
platformDdl.regenerateHistoryTriggers(writer, tableName);
|
||||
// also drop from the history table
|
||||
if (alterHistoryTables) {
|
||||
alterTableDropColumn(writer, historyTable(tableName), dropColumn.getColumnName());
|
||||
if (tableHistory != null) {
|
||||
alterTableDropColumn(writer, tableHistory.historyTableName(tableName), dropColumn.getColumnName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -773,13 +771,6 @@ public class BaseTableDdl implements TableDdl {
|
||||
platformDdl.addColumnComment(writer.applyPostAlter(), alterColumn.getTableName(), alterColumn.getColumnName(), alterColumn.getComment());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the history table given the base table name.
|
||||
*/
|
||||
protected String historyTable(String baseTable) {
|
||||
return naming.normaliseTable(baseTable) + historyTableSuffix;
|
||||
}
|
||||
|
||||
/**
|
||||
* alter all the base attributes (type/default/notnull) of the column together.
|
||||
* Some platforms (like mysql/sqlserver/hana) must do that in one statement,
|
||||
@@ -800,9 +791,9 @@ public class BaseTableDdl implements TableDdl {
|
||||
}
|
||||
if (applyToHistory) {
|
||||
platformDdl.regenerateHistoryTriggers(writer, alter.getTableName());
|
||||
if (alterHistoryTables) {
|
||||
if (tableHistory != null) {
|
||||
AlterColumn alterHistoryColumn = new AlterColumn();
|
||||
alterHistoryColumn.setTableName(historyTable(alter.getTableName()));
|
||||
alterHistoryColumn.setTableName(tableHistory.historyTableName(alter.getTableName()));
|
||||
alterHistoryColumn.setColumnName(alter.getColumnName());
|
||||
// ignore default value (not needed on history tables)
|
||||
alterHistoryColumn.setCurrentType(alter.getCurrentType());
|
||||
|
||||
+12
-4
@@ -104,15 +104,21 @@ public class DB2Ddl extends PlatformDdl {
|
||||
+ "\n" + dropIndex(uniqueConstraintName, tableName);
|
||||
}
|
||||
|
||||
private void assertNoSchema(String objName) {
|
||||
if (objName.indexOf('.') != -1) {
|
||||
throw new UnsupportedOperationException("Schemas are not yet supported. ObjectName: '" + objName + "'");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String alterTableDropConstraint(String tableName, String constraintName) {
|
||||
assertNoSchema(tableName);
|
||||
StringBuilder sb = new StringBuilder(300);
|
||||
sb.append("delimiter $$\n")
|
||||
.append("begin\n")
|
||||
.append("if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = '")
|
||||
.append("if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = '")
|
||||
.append(maxConstraintName(constraintName).toUpperCase())
|
||||
|
||||
.append("' and tabname = '").append(naming.normaliseTable(tableName).toUpperCase()).append("') then\n")
|
||||
.append("' and ucase(tabname) = '").append(naming.normaliseTable(tableName).toUpperCase()).append("') then\n")
|
||||
|
||||
.append(" prepare stmt from 'alter table ").append(tableName)
|
||||
.append(" drop constraint ").append(maxConstraintName(constraintName)).append("';\n")
|
||||
@@ -126,10 +132,11 @@ public class DB2Ddl extends PlatformDdl {
|
||||
|
||||
@Override
|
||||
public String dropIndex(String indexName, String tableName, boolean concurrent) {
|
||||
assertNoSchema(indexName);
|
||||
StringBuilder sb = new StringBuilder(300);
|
||||
sb.append("delimiter $$\n")
|
||||
.append("begin\n")
|
||||
.append("if exists (select indname from syscat.indexes where indschema = current_schema and indname = '")
|
||||
.append("if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = '")
|
||||
.append(maxConstraintName(indexName).toUpperCase()).append("') then\n")
|
||||
.append(" prepare stmt from 'drop index ").append(maxConstraintName(indexName)).append("';\n")
|
||||
.append(" execute stmt;\n")
|
||||
@@ -140,10 +147,11 @@ public class DB2Ddl extends PlatformDdl {
|
||||
|
||||
@Override
|
||||
public String dropSequence(String sequenceName) {
|
||||
assertNoSchema(sequenceName);
|
||||
StringBuilder sb = new StringBuilder(300);
|
||||
sb.append("delimiter $$\n");
|
||||
sb.append("begin\n");
|
||||
sb.append("if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = '")
|
||||
sb.append("if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = '")
|
||||
.append(maxConstraintName(sequenceName).toUpperCase()).append("') then\n");
|
||||
sb.append(" prepare stmt from 'drop sequence ").append(maxConstraintName(sequenceName)).append("';\n");
|
||||
sb.append(" execute stmt;\n");
|
||||
|
||||
+5
-19
@@ -1,7 +1,6 @@
|
||||
package io.ebeaninternal.dbmigration.ddlgeneration.platform;
|
||||
|
||||
import io.ebean.config.DatabaseConfig;
|
||||
import io.ebean.config.DbConstraintNaming;
|
||||
import io.ebeaninternal.dbmigration.ddlgeneration.DdlAlterTable;
|
||||
import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer;
|
||||
import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite;
|
||||
@@ -14,29 +13,24 @@ import io.ebeaninternal.dbmigration.model.MTable;
|
||||
*
|
||||
* @author Roland Praml, FOCONIS AG
|
||||
*/
|
||||
public class Db2HistoryDdl implements PlatformHistoryDdl {
|
||||
public class Db2HistoryDdl extends DbTableBasedHistoryDdl implements PlatformHistoryDdl {
|
||||
|
||||
private String systemPeriodStart;
|
||||
private String systemPeriodEnd;
|
||||
private String transactionId;
|
||||
private PlatformDdl platformDdl;
|
||||
private DbConstraintNaming constraintNaming;
|
||||
private String historySuffix;
|
||||
|
||||
@Override
|
||||
public void configure(DatabaseConfig config, PlatformDdl platformDdl) {
|
||||
super.configure(config, platformDdl);
|
||||
this.systemPeriodStart = config.getAsOfSysPeriod() + "_start";
|
||||
this.systemPeriodEnd = config.getAsOfSysPeriod() + "_end";
|
||||
this.transactionId = config.getAsOfSysPeriod() + "_txn"; // required for DB2
|
||||
this.platformDdl = platformDdl;
|
||||
this.constraintNaming = config.getConstraintNaming();
|
||||
this.historySuffix = config.getHistoryTableSuffix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createWithHistory(DdlWrite writer, MTable table) {
|
||||
String tableName = table.getName();
|
||||
String historyTableName = historyTable(tableName);
|
||||
String historyTableName = historyTableName(tableName);
|
||||
|
||||
// DB2 requires an EXACT copy (same column types with null/non-null, same order)
|
||||
addSysPeriodColumns(writer, tableName);
|
||||
@@ -85,7 +79,7 @@ public class Db2HistoryDdl implements PlatformHistoryDdl {
|
||||
platformDdl.alterTableDropColumn(writer, baseTable, transactionId);
|
||||
|
||||
// drop the history table
|
||||
writer.applyPostAlter().append("drop table ").append(historyTable(baseTable)).endOfStatement();
|
||||
writer.applyPostAlter().append("drop table ").append(historyTableName(baseTable)).endOfStatement();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -97,10 +91,6 @@ public class Db2HistoryDdl implements PlatformHistoryDdl {
|
||||
createWithHistory(writer, table);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean alterHistoryTables() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTriggers(DdlWrite writer, String tableName) {
|
||||
@@ -118,11 +108,7 @@ public class Db2HistoryDdl implements PlatformHistoryDdl {
|
||||
}
|
||||
|
||||
public void enableSystemVersioning(DdlBuffer apply, String tableName) {
|
||||
apply.append("alter table ").append(tableName).append(" add versioning use history table ").append(historyTable(tableName)).endOfStatement();
|
||||
}
|
||||
|
||||
protected String historyTable(String tableName) {
|
||||
return constraintNaming.normaliseTable(tableName) + historySuffix;
|
||||
apply.append("alter table ").append(tableName).append(" add versioning use history table ").append(historyTableName(tableName)).endOfStatement();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+44
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
+8
-31
@@ -1,7 +1,6 @@
|
||||
package io.ebeaninternal.dbmigration.ddlgeneration.platform;
|
||||
|
||||
import io.ebean.config.DatabaseConfig;
|
||||
import io.ebean.config.DbConstraintNaming;
|
||||
import io.ebeaninternal.dbmigration.ddlgeneration.DdlAlterTable;
|
||||
import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer;
|
||||
import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite;
|
||||
@@ -15,18 +14,14 @@ import java.util.List;
|
||||
/**
|
||||
* Uses DB triggers to maintain a history table.
|
||||
*/
|
||||
public abstract class DbTriggerBasedHistoryDdl implements PlatformHistoryDdl {
|
||||
|
||||
protected DbConstraintNaming constraintNaming;
|
||||
|
||||
protected PlatformDdl platformDdl;
|
||||
public abstract class DbTriggerBasedHistoryDdl extends DbTableBasedHistoryDdl implements PlatformHistoryDdl {
|
||||
|
||||
protected String sysPeriod;
|
||||
protected String sysPeriodStart;
|
||||
protected String sysPeriodEnd;
|
||||
|
||||
protected String viewSuffix;
|
||||
protected String historySuffix;
|
||||
|
||||
|
||||
protected String sysPeriodType = "datetime(6)";
|
||||
protected String now = "now(6)";
|
||||
@@ -37,11 +32,9 @@ public abstract class DbTriggerBasedHistoryDdl implements PlatformHistoryDdl {
|
||||
|
||||
@Override
|
||||
public void configure(DatabaseConfig config, PlatformDdl platformDdl) {
|
||||
this.platformDdl = platformDdl;
|
||||
super.configure(config, platformDdl);
|
||||
this.sysPeriod = config.getAsOfSysPeriod();
|
||||
this.viewSuffix = config.getAsOfViewSuffix();
|
||||
this.historySuffix = config.getHistoryTableSuffix();
|
||||
this.constraintNaming = config.getConstraintNaming();
|
||||
|
||||
this.sysPeriodStart = sysPeriod + "_start";
|
||||
this.sysPeriodEnd = sysPeriod + "_end";
|
||||
@@ -121,33 +114,24 @@ public abstract class DbTriggerBasedHistoryDdl implements PlatformHistoryDdl {
|
||||
|
||||
protected abstract void dropTriggers(DdlBuffer buffer, String baseTable);
|
||||
|
||||
|
||||
protected String normalise(String tableName) {
|
||||
return constraintNaming.normaliseTable(tableName);
|
||||
}
|
||||
|
||||
protected String historyTableName(String baseTableName) {
|
||||
return quote(normalise(baseTableName) + historySuffix);
|
||||
}
|
||||
|
||||
protected String historyViewName(String baseTableName) {
|
||||
return quote(normalise(baseTableName) + viewSuffix);
|
||||
return normalise(baseTableName, viewSuffix);
|
||||
}
|
||||
|
||||
protected String procedureName(String baseTableName) {
|
||||
return normalise(baseTableName) + "_history_version";
|
||||
return normalise(baseTableName, "_history_version");
|
||||
}
|
||||
|
||||
protected String triggerName(String baseTableName) {
|
||||
return normalise(baseTableName) + "_history_upd";
|
||||
return normalise(baseTableName, "_history_upd");
|
||||
}
|
||||
|
||||
protected String updateTriggerName(String baseTableName) {
|
||||
return normalise(baseTableName) + "_history_upd";
|
||||
return normalise(baseTableName, "_history_upd");
|
||||
}
|
||||
|
||||
protected String deleteTriggerName(String baseTableName) {
|
||||
return normalise(baseTableName) + "_history_del";
|
||||
return normalise(baseTableName, "_history_del");
|
||||
}
|
||||
|
||||
protected void addSysPeriodColumns(DdlWrite writer, String baseTableName, String whenCreatedColumn) {
|
||||
@@ -266,12 +250,5 @@ public abstract class DbTriggerBasedHistoryDdl implements PlatformHistoryDdl {
|
||||
return table.allHistoryColumns(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean alterHistoryTables() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected String quote(String dbName) {
|
||||
return platformDdl.quote(dbName);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-16
@@ -1,7 +1,6 @@
|
||||
package io.ebeaninternal.dbmigration.ddlgeneration.platform;
|
||||
|
||||
import io.ebean.config.DatabaseConfig;
|
||||
import io.ebean.config.DbConstraintNaming;
|
||||
import io.ebeaninternal.dbmigration.ddlgeneration.DdlAlterTable;
|
||||
import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer;
|
||||
import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite;
|
||||
@@ -12,21 +11,16 @@ import io.ebeaninternal.dbmigration.model.MTable;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class HanaHistoryDdl implements PlatformHistoryDdl {
|
||||
public class HanaHistoryDdl extends DbTableBasedHistoryDdl implements PlatformHistoryDdl {
|
||||
|
||||
private String systemPeriodStart;
|
||||
private String systemPeriodEnd;
|
||||
private PlatformDdl platformDdl;
|
||||
private DbConstraintNaming constraintNaming;
|
||||
private String historySuffix;
|
||||
|
||||
@Override
|
||||
public void configure(DatabaseConfig config, PlatformDdl platformDdl) {
|
||||
super.configure(config, platformDdl);
|
||||
this.systemPeriodStart = config.getAsOfSysPeriod() + "_start";
|
||||
this.systemPeriodEnd = config.getAsOfSysPeriod() + "_end";
|
||||
this.platformDdl = platformDdl;
|
||||
this.constraintNaming = config.getConstraintNaming();
|
||||
this.historySuffix = config.getHistoryTableSuffix();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -95,11 +89,6 @@ public class HanaHistoryDdl implements PlatformHistoryDdl {
|
||||
createWithHistory(writer, table);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean alterHistoryTables() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTriggers(DdlWrite writer, String tableName) {
|
||||
DdlAlterTable alter = platformDdl.alterTable(writer, tableName);
|
||||
@@ -140,8 +129,5 @@ public class HanaHistoryDdl implements PlatformHistoryDdl {
|
||||
apply.endOfStatement();
|
||||
}
|
||||
|
||||
protected String historyTableName(String tableName) {
|
||||
return constraintNaming.normaliseTable(tableName) + historySuffix;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+11
-8
@@ -31,14 +31,6 @@ public interface PlatformHistoryDdl {
|
||||
*/
|
||||
void addHistoryTable(DdlWrite writer, AddHistoryTable addHistoryTable);
|
||||
|
||||
/**
|
||||
* Returns true, if alters on the live tables should be applied also to the history tables. This is required for DbTriggerBased
|
||||
* histories or on platforms like Hana, which are not SQL2011 history compatible (at least from DDL perspective)
|
||||
*/
|
||||
default boolean alterHistoryTables() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Regenerate the history triggers/stored function due to column added/dropped/included or excluded.
|
||||
*
|
||||
@@ -47,4 +39,15 @@ public interface PlatformHistoryDdl {
|
||||
default void updateTriggers(DdlWrite writer, String tableName) {
|
||||
// nop
|
||||
}
|
||||
|
||||
/**
|
||||
* When history is table based, then alters on the live tables are applied also to the history tables. This is required for
|
||||
* DbTriggerBased histories or on platforms like Hana, which are not SQL2011 history compatible (at least from DDL perspective)
|
||||
*/
|
||||
interface TableBased extends PlatformHistoryDdl {
|
||||
/**
|
||||
* Returns the history table name with propert quotes.
|
||||
*/
|
||||
public String historyTableName(String baseTableName);
|
||||
}
|
||||
}
|
||||
|
||||
+19
@@ -107,4 +107,23 @@ public class PostgresHistoryDdl extends DbTriggerBasedHistoryDdl {
|
||||
buffer.append(");").newLine();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String procedureName(String baseTableName) {
|
||||
return normalise(baseTableName) + "_history_version";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String triggerName(String baseTableName) {
|
||||
return normalise(baseTableName) + "_history_upd";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String updateTriggerName(String baseTableName) {
|
||||
return normalise(baseTableName) + "_history_upd";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String deleteTriggerName(String baseTableName) {
|
||||
return normalise(baseTableName) + "_history_del";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,10 @@ import org.junit.jupiter.api.Test;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -60,35 +62,38 @@ public class DbMigrationTest extends BaseTestCase {
|
||||
((ConnectionPool)server().dataSource()).offline();
|
||||
((ConnectionPool)server().dataSource()).online();
|
||||
cleanup("migtest_ckey_assoc",
|
||||
"migtest_ckey_detail",
|
||||
"migtest_ckey_parent",
|
||||
"migtest_e_basic",
|
||||
"migtest_e_enum",
|
||||
"migtest_e_history",
|
||||
"migtest_e_history2",
|
||||
"migtest_e_history3",
|
||||
"migtest_e_history4",
|
||||
"migtest_e_history5",
|
||||
"migtest_e_history6",
|
||||
"migtest_e_ref",
|
||||
"migtest_e_softdelete",
|
||||
"migtest_e_user",
|
||||
"migtest_fk_cascade",
|
||||
"migtest_fk_cascade_one",
|
||||
"migtest_fk_none",
|
||||
"migtest_fk_none_via_join",
|
||||
"migtest_fk_one",
|
||||
"migtest_fk_set_null",
|
||||
"migtest_mtm_c",
|
||||
"migtest_mtm_m",
|
||||
"migtest_mtm_m_phone_numbers",
|
||||
"migtest_mtm_c_migtest_mtm_m",
|
||||
"migtest_mtm_m_migtest_mtm_c",
|
||||
"migtest_oto_child",
|
||||
"migtest_oto_master",
|
||||
"table",
|
||||
"\"table\"",
|
||||
"`table`");
|
||||
"migtest_ckey_detail",
|
||||
"migtest_ckey_parent",
|
||||
"migtest_e_basic",
|
||||
"migtest_e_enum",
|
||||
"migtest_e_history",
|
||||
"migtest_e_history2",
|
||||
"migtest_e_history3",
|
||||
"migtest_e_history4",
|
||||
"migtest_e_history5",
|
||||
"migtest_e_history6",
|
||||
"migtest_e_ref",
|
||||
"migtest_e_softdelete",
|
||||
"migtest_e_user",
|
||||
"migtest_fk_cascade",
|
||||
"migtest_fk_cascade_one",
|
||||
"migtest_fk_none",
|
||||
"migtest_fk_none_via_join",
|
||||
"migtest_fk_one",
|
||||
"migtest_fk_set_null",
|
||||
"migtest_mtm_c",
|
||||
"migtest_mtm_m",
|
||||
"migtest_mtm_m_phone_numbers",
|
||||
"migtest_mtm_c_migtest_mtm_m",
|
||||
"migtest_mtm_m_migtest_mtm_c",
|
||||
"migtest_oto_child",
|
||||
"migtest_oto_master",
|
||||
"`migtest_QuOtEd`",
|
||||
"migtest_QuOtEd",
|
||||
"\"migtest_QuOtEd\"",
|
||||
"table",
|
||||
"\"table\"",
|
||||
"`table`");
|
||||
((ConnectionPool)server().dataSource()).offline();
|
||||
((ConnectionPool)server().dataSource()).online();
|
||||
|
||||
@@ -100,8 +105,17 @@ public class DbMigrationTest extends BaseTestCase {
|
||||
runScript("I__create_tablespaces.sql");
|
||||
}
|
||||
|
||||
if (!isOracle()) {
|
||||
// oracle.getMetaData is too slow. So skip this test
|
||||
assertThat(getTables()).doesNotContain("migtest_QuOtEd");
|
||||
}
|
||||
runScript("1.0__initial.sql");
|
||||
|
||||
if (!isOracle()) {
|
||||
assertThat(getTables()) // we expect exact spelling here
|
||||
.contains("migtest_QuOtEd")
|
||||
.doesNotContain("migtest_quoted")
|
||||
.doesNotContain("MIGTEST_QUOTED");
|
||||
}
|
||||
if (isClickHouse()) {
|
||||
// ClickHouse does not support transactions, so we cannot do update statements
|
||||
// Add column is also not implemented. So exit here
|
||||
@@ -164,7 +178,10 @@ public class DbMigrationTest extends BaseTestCase {
|
||||
return;
|
||||
}
|
||||
runScript("1.2__dropsFor_1.1.sql");
|
||||
|
||||
if (!isOracle()) {
|
||||
// too slow!
|
||||
assertThat(getTables()).doesNotContain("migtest_QuOtEd");
|
||||
}
|
||||
// Oracle caches the statement and does not detect schema change. It fails with
|
||||
// an ORA-01007
|
||||
result = server().sqlQuery("select * from migtest_e_basic order by id,status").findList();
|
||||
@@ -349,4 +366,15 @@ public class DbMigrationTest extends BaseTestCase {
|
||||
server().script().runScript("cleanup", sb.toString(), true);
|
||||
server().script().runScript("cleanup", sb.toString(), true);
|
||||
}
|
||||
|
||||
private List<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
|
||||
) ENGINE = Log();
|
||||
|
||||
create table "migtest_QuOtEd" (
|
||||
id String,
|
||||
status1 String,
|
||||
status2 String
|
||||
) ENGINE = Log();
|
||||
|
||||
create table migtest_e_ref (
|
||||
id UInt32,
|
||||
name String
|
||||
|
||||
+1
@@ -7,4 +7,5 @@ alter table migtest_e_basic drop column eref_id;
|
||||
alter table migtest_e_history2 drop column obsolete_string1;
|
||||
alter table migtest_e_history2 drop column obsolete_string2;
|
||||
-- apply post alter
|
||||
drop table if exists "migtest_QuOtEd";
|
||||
drop table if exists migtest_e_ref;
|
||||
|
||||
@@ -9,6 +9,12 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4;
|
||||
alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5;
|
||||
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
|
||||
-- apply changes
|
||||
create table "migtest_QuOtEd" (
|
||||
id String,
|
||||
status1 String,
|
||||
status2 String
|
||||
) ENGINE = Log();
|
||||
|
||||
create table migtest_e_ref (
|
||||
id UInt32,
|
||||
name String
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
863321871, 1.0__initial.sql
|
||||
235371332, 1.0__initial.sql
|
||||
1903846331, 1.1.sql
|
||||
1279151426, 1.2__dropsFor_1.1.sql
|
||||
1630693278, 1.3.sql
|
||||
688811494, 1.2__dropsFor_1.1.sql
|
||||
1015552567, 1.3.sql
|
||||
80209848, 1.4__dropsFor_1.3.sql
|
||||
|
||||
|
||||
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
|
||||
constraint pk_migtest_e_history6 primary key (id)
|
||||
);
|
||||
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
name varchar(127) not null,
|
||||
@@ -190,4 +200,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
create index ix_table_from on "table" ("from");
|
||||
|
||||
@@ -9,6 +9,7 @@ drop index uq_migtest_e_basic_indextest6 cascade;
|
||||
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
|
||||
drop index if exists ix_migtest_e_basic_indextest1;
|
||||
drop index if exists ix_migtest_e_basic_indextest5;
|
||||
drop index if exists ix_migtest_quoted_status1;
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer generated by default as identity not null,
|
||||
|
||||
+1
@@ -7,5 +7,6 @@ alter table migtest_e_basic drop column eref_id;
|
||||
alter table migtest_e_history2 drop column obsolete_string1;
|
||||
alter table migtest_e_history2 drop column obsolete_string2;
|
||||
-- apply post alter
|
||||
drop table if exists "migtest_QuOtEd" cascade;
|
||||
drop table if exists migtest_e_ref cascade;
|
||||
drop sequence if exists migtest_e_ref_seq;
|
||||
|
||||
@@ -17,6 +17,16 @@ alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_stat
|
||||
drop index if exists ix_migtest_e_basic_indextest3;
|
||||
drop index if exists ix_migtest_e_basic_indextest6;
|
||||
-- apply changes
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
name varchar(127) not null,
|
||||
@@ -71,3 +81,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
1636200128, 1.0__initial.sql
|
||||
356413151, 1.1.sql
|
||||
240919209, 1.2__dropsFor_1.1.sql
|
||||
-430000356, 1.3.sql
|
||||
-703764770, 1.0__initial.sql
|
||||
751308758, 1.1.sql
|
||||
856096334, 1.2__dropsFor_1.1.sql
|
||||
17665322, 1.3.sql
|
||||
-820814009, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -125,6 +125,15 @@ create table migtest_e_history6 (
|
||||
constraint pk_migtest_e_history6 primary key (id)
|
||||
);
|
||||
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
name varchar(127) not null,
|
||||
@@ -209,6 +218,7 @@ create table migtest_e_history5_history as (select * from migtest_e_history5) wi
|
||||
alter table migtest_e_history5 add versioning use history table migtest_e_history5_history;
|
||||
create table migtest_e_history6_history as (select * from migtest_e_history6) with no data;
|
||||
alter table migtest_e_history6 add versioning use history table migtest_e_history6_history;
|
||||
create unique index uq_migtest_quoted_status2 on "migtest_QuOtEd"(status2) exclude null keys;
|
||||
alter table migtest_e_ref add constraint uq_migtest_e_ref_name unique (name);
|
||||
create unique index uq_table_to on "table"("to") exclude null keys;
|
||||
create unique index uq_table_varchar on "table"("varchar") exclude null keys;
|
||||
@@ -229,4 +239,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
create index ix_table_from on "table" ("from");
|
||||
|
||||
@@ -2,81 +2,88 @@
|
||||
-- drop dependencies
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and tabname = 'MIGTEST_FK_CASCADE') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_CASCADE') then
|
||||
prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and tabname = 'MIGTEST_FK_SET_NULL') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_SET_NULL') then
|
||||
prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS2' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST2' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest2';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST2') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST2') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_indextest2';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST6' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST6' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST6') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST6') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_indextest6';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and tabname = 'MIGTEST_E_ENUM') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and ucase(tabname) = 'MIGTEST_E_ENUM') then
|
||||
prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then
|
||||
prepare stmt from 'drop index ix_migtest_e_basic_indextest1';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST5') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST5') then
|
||||
prepare stmt from 'drop index ix_migtest_e_basic_indextest5';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_QUOTED_STATUS1') then
|
||||
prepare stmt from 'drop index ix_migtest_quoted_status1';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer generated by default as identity not null,
|
||||
|
||||
+2
-1
@@ -15,10 +15,11 @@ alter table migtest_e_history2_history drop column obsolete_string2;
|
||||
call sysproc.admin_cmd('reorg table migtest_e_history2_history');
|
||||
-- apply post alter
|
||||
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
|
||||
drop table "migtest_QuOtEd";
|
||||
drop table migtest_e_ref;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = 'MIGTEST_E_REF_SEQ') then
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_REF_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_ref_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
|
||||
@@ -2,152 +2,161 @@
|
||||
-- drop dependencies
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_CKEY_DETAIL_PARENT' and tabname = 'MIGTEST_CKEY_DETAIL') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_CKEY_DETAIL_PARENT' and ucase(tabname) = 'MIGTEST_CKEY_DETAIL') then
|
||||
prepare stmt from 'alter table migtest_ckey_detail drop constraint fk_migtest_ckey_detail_parent';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and tabname = 'MIGTEST_FK_CASCADE') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_CASCADE') then
|
||||
prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_NONE_ONE_ID' and tabname = 'MIGTEST_FK_NONE') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_NONE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_NONE') then
|
||||
prepare stmt from 'alter table migtest_fk_none drop constraint fk_migtest_fk_none_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_NONE_VIA_JOIN_ONE_ID' and tabname = 'MIGTEST_FK_NONE_VIA_JOIN') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_NONE_VIA_JOIN_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_NONE_VIA_JOIN') then
|
||||
prepare stmt from 'alter table migtest_fk_none_via_join drop constraint fk_migtest_fk_none_via_join_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and tabname = 'MIGTEST_FK_SET_NULL') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_SET_NULL') then
|
||||
prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS2' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_DESCRIPTION' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_DESCRIPTION' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_description';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_DESCRIPTION') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_DESCRIPTION') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_description';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_E_BASIC_USER_ID' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_E_BASIC_USER_ID' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint fk_migtest_e_basic_user_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_status_indextest1';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_status_indextest1';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_NAME' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_NAME' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_name';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_NAME') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_NAME') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_name';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST4' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST4' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST4') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST4') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_indextest4';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST5' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST5' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST5') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST5') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_indextest5';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and tabname = 'MIGTEST_E_ENUM') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and ucase(tabname) = 'MIGTEST_E_ENUM') then
|
||||
prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST3') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST3') then
|
||||
prepare stmt from 'drop index ix_migtest_e_basic_indextest3';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST6') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST6') then
|
||||
prepare stmt from 'drop index ix_migtest_e_basic_indextest6';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
-- apply changes
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
name varchar(127) not null,
|
||||
@@ -207,6 +216,7 @@ alter table migtest_e_history6_history alter column test_number1 drop not null;
|
||||
alter table migtest_e_history6_history alter column test_number2 set not null;
|
||||
call sysproc.admin_cmd('reorg table migtest_e_history6_history');
|
||||
-- apply post alter
|
||||
create unique index uq_migtest_quoted_status2 on "migtest_QuOtEd"(status2) exclude null keys;
|
||||
alter table migtest_e_ref add constraint uq_migtest_e_ref_name unique (name);
|
||||
alter table migtest_e_basic add constraint ck_migtest_e_basic_status check ( status in ('N','A','I'));
|
||||
alter table migtest_e_basic add constraint ck_migtest_e_basic_status2 check ( status2 in ('N','A','I'));
|
||||
@@ -228,3 +238,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ alter table migtest_e_history5 add versioning use history table migtest_e_histor
|
||||
drop table migtest_e_user;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = 'MIGTEST_E_USER_SEQ') then
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_USER_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_user_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
|
||||
@@ -125,6 +125,15 @@ create table migtest_e_history6 (
|
||||
constraint pk_migtest_e_history6 primary key (id)
|
||||
);
|
||||
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_mgtst_qtd_stts1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_mgtst_qtd_stts2 check ( status2 in ('N','A','I')),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
name varchar(127) not null,
|
||||
@@ -209,6 +218,7 @@ create table migtest_e_history5_history as (select * from migtest_e_history5) wi
|
||||
alter table migtest_e_history5 add versioning use history table migtest_e_history5_history;
|
||||
create table migtest_e_history6_history as (select * from migtest_e_history6) with no data;
|
||||
alter table migtest_e_history6 add versioning use history table migtest_e_history6_history;
|
||||
create unique index uq_mgtst_qtd_stts2 on "migtest_QuOtEd"(status2) exclude null keys;
|
||||
alter table migtest_e_ref add constraint uq_mgtst__rf_nm unique (name);
|
||||
create unique index uq_table_to on "table"("to") exclude null keys;
|
||||
create unique index uq_table_varchar on "table"("varchar") exclude null keys;
|
||||
@@ -229,4 +239,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
|
||||
|
||||
create index ix_mgtst__b_eu8csq on migtest_e_basic (indextest1);
|
||||
create index ix_mgtst__b_eu8csu on migtest_e_basic (indextest5);
|
||||
create index ix_mgtst_qtd_stts1 on "migtest_QuOtEd" (status1);
|
||||
create index ix_table_from on "table" ("from");
|
||||
|
||||
@@ -2,81 +2,88 @@
|
||||
-- drop dependencies
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MGTST_FK_65KF6L' and tabname = 'MIGTEST_FK_CASCADE') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MGTST_FK_65KF6L' and ucase(tabname) = 'MIGTEST_FK_CASCADE') then
|
||||
prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_mgtst_fk_65kf6l';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MGTST_FK_WICX8X' and tabname = 'MIGTEST_FK_SET_NULL') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MGTST_FK_WICX8X' and ucase(tabname) = 'MIGTEST_FK_SET_NULL') then
|
||||
prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_mgtst_fk_wicx8x';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MGTST__BSC_STTS' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MGTST__BSC_STTS' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint ck_mgtst__bsc_stts';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MGTST__B_Z543FG' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MGTST__B_Z543FG' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint ck_mgtst__b_z543fg';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MGTST__B_4AYBZY' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MGTST__B_4AYBZY' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_4aybzy';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MGTST__B_4AYBZY') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MGTST__B_4AYBZY') then
|
||||
prepare stmt from 'drop index uq_mgtst__b_4aybzy';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MGTST__B_4AYC02' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MGTST__B_4AYC02' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_4ayc02';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MGTST__B_4AYC02') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MGTST__B_4AYC02') then
|
||||
prepare stmt from 'drop index uq_mgtst__b_4ayc02';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MGTST__N_773SOK' and tabname = 'MIGTEST_E_ENUM') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MGTST__N_773SOK' and ucase(tabname) = 'MIGTEST_E_ENUM') then
|
||||
prepare stmt from 'alter table migtest_e_enum drop constraint ck_mgtst__n_773sok';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MGTST__B_EU8CSQ') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MGTST__B_EU8CSQ') then
|
||||
prepare stmt from 'drop index ix_mgtst__b_eu8csq';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MGTST__B_EU8CSU') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MGTST__B_EU8CSU') then
|
||||
prepare stmt from 'drop index ix_mgtst__b_eu8csu';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MGTST_QTD_STTS1') then
|
||||
prepare stmt from 'drop index ix_mgtst_qtd_stts1';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer generated by default as identity not null,
|
||||
|
||||
+2
-1
@@ -15,10 +15,11 @@ alter table migtest_e_history2_history drop column obsolete_string2;
|
||||
call sysproc.admin_cmd('reorg table migtest_e_history2_history');
|
||||
-- apply post alter
|
||||
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
|
||||
drop table "migtest_QuOtEd";
|
||||
drop table migtest_e_ref;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = 'MIGTEST_E_REF_SEQ') then
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_REF_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_ref_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
|
||||
@@ -2,152 +2,161 @@
|
||||
-- drop dependencies
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MGTST_CK_E1QKB5' and tabname = 'MIGTEST_CKEY_DETAIL') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MGTST_CK_E1QKB5' and ucase(tabname) = 'MIGTEST_CKEY_DETAIL') then
|
||||
prepare stmt from 'alter table migtest_ckey_detail drop constraint fk_mgtst_ck_e1qkb5';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MGTST_FK_65KF6L' and tabname = 'MIGTEST_FK_CASCADE') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MGTST_FK_65KF6L' and ucase(tabname) = 'MIGTEST_FK_CASCADE') then
|
||||
prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_mgtst_fk_65kf6l';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MGTST_FK_NN_N_D' and tabname = 'MIGTEST_FK_NONE') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MGTST_FK_NN_N_D' and ucase(tabname) = 'MIGTEST_FK_NONE') then
|
||||
prepare stmt from 'alter table migtest_fk_none drop constraint fk_mgtst_fk_nn_n_d';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MGTST_FK_9TKNZJ' and tabname = 'MIGTEST_FK_NONE_VIA_JOIN') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MGTST_FK_9TKNZJ' and ucase(tabname) = 'MIGTEST_FK_NONE_VIA_JOIN') then
|
||||
prepare stmt from 'alter table migtest_fk_none_via_join drop constraint fk_mgtst_fk_9tknzj';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MGTST_FK_WICX8X' and tabname = 'MIGTEST_FK_SET_NULL') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MGTST_FK_WICX8X' and ucase(tabname) = 'MIGTEST_FK_SET_NULL') then
|
||||
prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_mgtst_fk_wicx8x';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MGTST__BSC_STTS' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MGTST__BSC_STTS' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint ck_mgtst__bsc_stts';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MGTST__B_Z543FG' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MGTST__B_Z543FG' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint ck_mgtst__b_z543fg';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MGTST__B_VS45XO' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MGTST__B_VS45XO' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_vs45xo';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MGTST__B_VS45XO') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MGTST__B_VS45XO') then
|
||||
prepare stmt from 'drop index uq_mgtst__b_vs45xo';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MGTST__BSC_SR_D' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MGTST__BSC_SR_D' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint fk_mgtst__bsc_sr_d';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MGTST__B_UCFCNE' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MGTST__B_UCFCNE' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_ucfcne';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MGTST__B_UCFCNE') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MGTST__B_UCFCNE') then
|
||||
prepare stmt from 'drop index uq_mgtst__b_ucfcne';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MGTST__BSC_NM' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MGTST__BSC_NM' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__bsc_nm';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MGTST__BSC_NM') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MGTST__BSC_NM') then
|
||||
prepare stmt from 'drop index uq_mgtst__bsc_nm';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MGTST__B_4AYC00' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MGTST__B_4AYC00' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_4ayc00';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MGTST__B_4AYC00') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MGTST__B_4AYC00') then
|
||||
prepare stmt from 'drop index uq_mgtst__b_4ayc00';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MGTST__B_4AYC01' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MGTST__B_4AYC01' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_mgtst__b_4ayc01';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MGTST__B_4AYC01') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MGTST__B_4AYC01') then
|
||||
prepare stmt from 'drop index uq_mgtst__b_4ayc01';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MGTST__N_773SOK' and tabname = 'MIGTEST_E_ENUM') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MGTST__N_773SOK' and ucase(tabname) = 'MIGTEST_E_ENUM') then
|
||||
prepare stmt from 'alter table migtest_e_enum drop constraint ck_mgtst__n_773sok';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MGTST__B_EU8CSS') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MGTST__B_EU8CSS') then
|
||||
prepare stmt from 'drop index ix_mgtst__b_eu8css';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MGTST__B_EU8CSV') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MGTST__B_EU8CSV') then
|
||||
prepare stmt from 'drop index ix_mgtst__b_eu8csv';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
-- apply changes
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_mgtst_qtd_stts1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_mgtst_qtd_stts2 check ( status2 in ('N','A','I')),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
name varchar(127) not null,
|
||||
@@ -207,6 +216,7 @@ alter table migtest_e_history6_history alter column test_number1 drop not null;
|
||||
alter table migtest_e_history6_history alter column test_number2 set not null;
|
||||
call sysproc.admin_cmd('reorg table migtest_e_history6_history');
|
||||
-- apply post alter
|
||||
create unique index uq_mgtst_qtd_stts2 on "migtest_QuOtEd"(status2) exclude null keys;
|
||||
alter table migtest_e_ref add constraint uq_mgtst__rf_nm unique (name);
|
||||
alter table migtest_e_basic add constraint ck_mgtst__bsc_stts check ( status in ('N','A','I'));
|
||||
alter table migtest_e_basic add constraint ck_mgtst__b_z543fg check ( status2 in ('N','A','I'));
|
||||
@@ -228,3 +238,4 @@ alter table migtest_e_basic add constraint fk_mgtst__bsc_rf_d foreign key (eref_
|
||||
|
||||
create index ix_mgtst__b_eu8csq on migtest_e_basic (indextest1);
|
||||
create index ix_mgtst__b_eu8csu on migtest_e_basic (indextest5);
|
||||
create index ix_mgtst_qtd_stts1 on "migtest_QuOtEd" (status1);
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ alter table migtest_e_history5 add versioning use history table migtest_e_histor
|
||||
drop table migtest_e_user;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = 'MIGTEST_E_USER_SEQ') then
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_USER_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_user_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
|
||||
@@ -125,6 +125,15 @@ create table migtest_e_history6 (
|
||||
constraint pk_migtest_e_history6 primary key (id)
|
||||
);
|
||||
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
name varchar(127) not null,
|
||||
@@ -209,6 +218,7 @@ create table migtest_e_history5_history as (select * from migtest_e_history5) wi
|
||||
alter table migtest_e_history5 add versioning use history table migtest_e_history5_history;
|
||||
create table migtest_e_history6_history as (select * from migtest_e_history6) with no data;
|
||||
alter table migtest_e_history6 add versioning use history table migtest_e_history6_history;
|
||||
create unique index uq_migtest_quoted_status2 on "migtest_QuOtEd"(status2) exclude null keys;
|
||||
alter table migtest_e_ref add constraint uq_migtest_e_ref_name unique (name);
|
||||
create unique index uq_table_to on "table"("to") exclude null keys;
|
||||
create unique index uq_table_varchar on "table"("varchar") exclude null keys;
|
||||
@@ -229,4 +239,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
create index ix_table_from on "table" ("from");
|
||||
|
||||
@@ -2,81 +2,88 @@
|
||||
-- drop dependencies
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and tabname = 'MIGTEST_FK_CASCADE') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_CASCADE') then
|
||||
prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and tabname = 'MIGTEST_FK_SET_NULL') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_SET_NULL') then
|
||||
prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS2' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST2' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest2';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST2') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST2') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_indextest2';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST6' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST6' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST6') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST6') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_indextest6';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and tabname = 'MIGTEST_E_ENUM') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and ucase(tabname) = 'MIGTEST_E_ENUM') then
|
||||
prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then
|
||||
prepare stmt from 'drop index ix_migtest_e_basic_indextest1';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST5') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST5') then
|
||||
prepare stmt from 'drop index ix_migtest_e_basic_indextest5';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_QUOTED_STATUS1') then
|
||||
prepare stmt from 'drop index ix_migtest_quoted_status1';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer generated by default as identity not null,
|
||||
|
||||
+2
-1
@@ -15,10 +15,11 @@ alter table migtest_e_history2_history drop column obsolete_string2;
|
||||
call sysproc.admin_cmd('reorg table migtest_e_history2_history');
|
||||
-- apply post alter
|
||||
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
|
||||
drop table "migtest_QuOtEd";
|
||||
drop table migtest_e_ref;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = 'MIGTEST_E_REF_SEQ') then
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_REF_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_ref_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
|
||||
@@ -2,152 +2,161 @@
|
||||
-- drop dependencies
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_CKEY_DETAIL_PARENT' and tabname = 'MIGTEST_CKEY_DETAIL') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_CKEY_DETAIL_PARENT' and ucase(tabname) = 'MIGTEST_CKEY_DETAIL') then
|
||||
prepare stmt from 'alter table migtest_ckey_detail drop constraint fk_migtest_ckey_detail_parent';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and tabname = 'MIGTEST_FK_CASCADE') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_CASCADE') then
|
||||
prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_NONE_ONE_ID' and tabname = 'MIGTEST_FK_NONE') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_NONE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_NONE') then
|
||||
prepare stmt from 'alter table migtest_fk_none drop constraint fk_migtest_fk_none_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_NONE_VIA_JOIN_ONE_ID' and tabname = 'MIGTEST_FK_NONE_VIA_JOIN') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_NONE_VIA_JOIN_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_NONE_VIA_JOIN') then
|
||||
prepare stmt from 'alter table migtest_fk_none_via_join drop constraint fk_migtest_fk_none_via_join_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and tabname = 'MIGTEST_FK_SET_NULL') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_SET_NULL') then
|
||||
prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS2' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_DESCRIPTION' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_DESCRIPTION' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_description';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_DESCRIPTION') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_DESCRIPTION') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_description';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_E_BASIC_USER_ID' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_E_BASIC_USER_ID' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint fk_migtest_e_basic_user_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_status_indextest1';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_status_indextest1';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_NAME' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_NAME' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_name';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_NAME') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_NAME') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_name';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST4' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST4' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST4') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST4') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_indextest4';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST5' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST5' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST5') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST5') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_indextest5';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and tabname = 'MIGTEST_E_ENUM') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and ucase(tabname) = 'MIGTEST_E_ENUM') then
|
||||
prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST3') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST3') then
|
||||
prepare stmt from 'drop index ix_migtest_e_basic_indextest3';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST6') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST6') then
|
||||
prepare stmt from 'drop index ix_migtest_e_basic_indextest6';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
-- apply changes
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
name varchar(127) not null,
|
||||
@@ -207,6 +216,7 @@ alter table migtest_e_history6_history alter column test_number1 drop not null;
|
||||
alter table migtest_e_history6_history alter column test_number2 set not null;
|
||||
call sysproc.admin_cmd('reorg table migtest_e_history6_history');
|
||||
-- apply post alter
|
||||
create unique index uq_migtest_quoted_status2 on "migtest_QuOtEd"(status2) exclude null keys;
|
||||
alter table migtest_e_ref add constraint uq_migtest_e_ref_name unique (name);
|
||||
alter table migtest_e_basic add constraint ck_migtest_e_basic_status check ( status in ('N','A','I'));
|
||||
alter table migtest_e_basic add constraint ck_migtest_e_basic_status2 check ( status2 in ('N','A','I'));
|
||||
@@ -228,3 +238,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ alter table migtest_e_history5 add versioning use history table migtest_e_histor
|
||||
drop table migtest_e_user;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = 'MIGTEST_E_USER_SEQ') then
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_USER_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_user_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
|
||||
@@ -125,6 +125,15 @@ create table migtest_e_history6 (
|
||||
constraint pk_migtest_e_history6 primary key (id)
|
||||
);
|
||||
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
name varchar(127) not null,
|
||||
@@ -209,6 +218,7 @@ create table migtest_e_history5_history as (select * from migtest_e_history5) wi
|
||||
alter table migtest_e_history5 add versioning use history table migtest_e_history5_history;
|
||||
create table migtest_e_history6_history as (select * from migtest_e_history6) with no data;
|
||||
alter table migtest_e_history6 add versioning use history table migtest_e_history6_history;
|
||||
create unique index uq_migtest_quoted_status2 on "migtest_QuOtEd"(status2) exclude null keys;
|
||||
alter table migtest_e_ref add constraint uq_migtest_e_ref_name unique (name);
|
||||
create unique index uq_table_to on "table"("to") exclude null keys;
|
||||
create unique index uq_table_varchar on "table"("varchar") exclude null keys;
|
||||
@@ -229,4 +239,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
create index ix_table_from on "table" ("from");
|
||||
|
||||
@@ -2,81 +2,88 @@
|
||||
-- drop dependencies
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and tabname = 'MIGTEST_FK_CASCADE') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_CASCADE') then
|
||||
prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and tabname = 'MIGTEST_FK_SET_NULL') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_SET_NULL') then
|
||||
prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS2' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST2' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest2';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST2') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST2') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_indextest2';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST6' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST6' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST6') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST6') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_indextest6';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and tabname = 'MIGTEST_E_ENUM') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and ucase(tabname) = 'MIGTEST_E_ENUM') then
|
||||
prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST1') then
|
||||
prepare stmt from 'drop index ix_migtest_e_basic_indextest1';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST5') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST5') then
|
||||
prepare stmt from 'drop index ix_migtest_e_basic_indextest5';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_QUOTED_STATUS1') then
|
||||
prepare stmt from 'drop index ix_migtest_quoted_status1';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer generated by default as identity not null,
|
||||
|
||||
+2
-1
@@ -15,10 +15,11 @@ alter table migtest_e_history2_history drop column obsolete_string2;
|
||||
call sysproc.admin_cmd('reorg table migtest_e_history2_history');
|
||||
-- apply post alter
|
||||
alter table migtest_e_history2 add versioning use history table migtest_e_history2_history;
|
||||
drop table "migtest_QuOtEd";
|
||||
drop table migtest_e_ref;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = 'MIGTEST_E_REF_SEQ') then
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_REF_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_ref_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
|
||||
@@ -2,152 +2,161 @@
|
||||
-- drop dependencies
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_CKEY_DETAIL_PARENT' and tabname = 'MIGTEST_CKEY_DETAIL') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_CKEY_DETAIL_PARENT' and ucase(tabname) = 'MIGTEST_CKEY_DETAIL') then
|
||||
prepare stmt from 'alter table migtest_ckey_detail drop constraint fk_migtest_ckey_detail_parent';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and tabname = 'MIGTEST_FK_CASCADE') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_CASCADE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_CASCADE') then
|
||||
prepare stmt from 'alter table migtest_fk_cascade drop constraint fk_migtest_fk_cascade_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_NONE_ONE_ID' and tabname = 'MIGTEST_FK_NONE') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_NONE_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_NONE') then
|
||||
prepare stmt from 'alter table migtest_fk_none drop constraint fk_migtest_fk_none_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_NONE_VIA_JOIN_ONE_ID' and tabname = 'MIGTEST_FK_NONE_VIA_JOIN') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_NONE_VIA_JOIN_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_NONE_VIA_JOIN') then
|
||||
prepare stmt from 'alter table migtest_fk_none_via_join drop constraint fk_migtest_fk_none_via_join_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and tabname = 'MIGTEST_FK_SET_NULL') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_FK_SET_NULL_ONE_ID' and ucase(tabname) = 'MIGTEST_FK_SET_NULL') then
|
||||
prepare stmt from 'alter table migtest_fk_set_null drop constraint fk_migtest_fk_set_null_one_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_BASIC_STATUS2' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_BASIC_STATUS2' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint ck_migtest_e_basic_status2';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_DESCRIPTION' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_DESCRIPTION' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_description';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_DESCRIPTION') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_DESCRIPTION') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_description';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'FK_MIGTEST_E_BASIC_USER_ID' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'FK_MIGTEST_E_BASIC_USER_ID' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint fk_migtest_e_basic_user_id';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_status_indextest1';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_STATUS_INDEXTEST1') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_status_indextest1';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_NAME' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_NAME' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_name';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_NAME') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_NAME') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_name';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST4' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST4' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest4';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST4') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST4') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_indextest4';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'UQ_MIGTEST_E_BASIC_INDEXTEST5' and tabname = 'MIGTEST_E_BASIC') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST5' and ucase(tabname) = 'MIGTEST_E_BASIC') then
|
||||
prepare stmt from 'alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest5';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'UQ_MIGTEST_E_BASIC_INDEXTEST5') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'UQ_MIGTEST_E_BASIC_INDEXTEST5') then
|
||||
prepare stmt from 'drop index uq_migtest_e_basic_indextest5';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and constname = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and tabname = 'MIGTEST_E_ENUM') then
|
||||
if exists (select constname from syscat.tabconst where tabschema = current_schema and ucase(constname) = 'CK_MIGTEST_E_ENUM_TEST_STATUS' and ucase(tabname) = 'MIGTEST_E_ENUM') then
|
||||
prepare stmt from 'alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST3') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST3') then
|
||||
prepare stmt from 'drop index ix_migtest_e_basic_indextest3';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and indname = 'IX_MIGTEST_E_BASIC_INDEXTEST6') then
|
||||
if exists (select indname from syscat.indexes where indschema = current_schema and ucase(indname) = 'IX_MIGTEST_E_BASIC_INDEXTEST6') then
|
||||
prepare stmt from 'drop index ix_migtest_e_basic_indextest6';
|
||||
execute stmt;
|
||||
end if;
|
||||
end$$;
|
||||
-- apply changes
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
name varchar(127) not null,
|
||||
@@ -207,6 +216,7 @@ alter table migtest_e_history6_history alter column test_number1 drop not null;
|
||||
alter table migtest_e_history6_history alter column test_number2 set not null;
|
||||
call sysproc.admin_cmd('reorg table migtest_e_history6_history');
|
||||
-- apply post alter
|
||||
create unique index uq_migtest_quoted_status2 on "migtest_QuOtEd"(status2) exclude null keys;
|
||||
alter table migtest_e_ref add constraint uq_migtest_e_ref_name unique (name);
|
||||
alter table migtest_e_basic add constraint ck_migtest_e_basic_status check ( status in ('N','A','I'));
|
||||
alter table migtest_e_basic add constraint ck_migtest_e_basic_status2 check ( status2 in ('N','A','I'));
|
||||
@@ -228,3 +238,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ alter table migtest_e_history5 add versioning use history table migtest_e_histor
|
||||
drop table migtest_e_user;
|
||||
delimiter $$
|
||||
begin
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and seqname = 'MIGTEST_E_USER_SEQ') then
|
||||
if exists (select seqschema from syscat.sequences where seqschema = current_schema and ucase(seqname) = 'MIGTEST_E_USER_SEQ') then
|
||||
prepare stmt from 'drop sequence migtest_e_user_seq';
|
||||
execute stmt;
|
||||
end if;
|
||||
|
||||
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
|
||||
constraint pk_migtest_e_history6 primary key (id)
|
||||
);
|
||||
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer auto_increment not null,
|
||||
name varchar(127) not null,
|
||||
@@ -191,4 +201,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
create index ix_table_from on "table" ("from");
|
||||
|
||||
@@ -9,6 +9,7 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6;
|
||||
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
|
||||
drop index if exists ix_migtest_e_basic_indextest1;
|
||||
drop index if exists ix_migtest_e_basic_indextest5;
|
||||
drop index if exists ix_migtest_quoted_status1;
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer auto_increment not null,
|
||||
|
||||
@@ -7,4 +7,5 @@ alter table migtest_e_basic drop column eref_id;
|
||||
alter table migtest_e_history2 drop column obsolete_string1;
|
||||
alter table migtest_e_history2 drop column obsolete_string2;
|
||||
-- apply post alter
|
||||
drop table if exists "migtest_QuOtEd";
|
||||
drop table if exists migtest_e_ref;
|
||||
|
||||
@@ -17,6 +17,16 @@ alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_stat
|
||||
drop index if exists ix_migtest_e_basic_indextest3;
|
||||
drop index if exists ix_migtest_e_basic_indextest6;
|
||||
-- apply changes
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer auto_increment not null,
|
||||
name varchar(127) not null,
|
||||
@@ -74,3 +84,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
-1347475412, 1.0__initial.sql
|
||||
2132717520, 1.1.sql
|
||||
1279151426, 1.2__dropsFor_1.1.sql
|
||||
-796269364, 1.3.sql
|
||||
-710189690, 1.0__initial.sql
|
||||
1626063176, 1.1.sql
|
||||
688811494, 1.2__dropsFor_1.1.sql
|
||||
2025934113, 1.3.sql
|
||||
80209848, 1.4__dropsFor_1.3.sql
|
||||
|
||||
|
||||
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
|
||||
constraint pk_migtest_e_history6 primary key (id)
|
||||
);
|
||||
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
name varchar(127) not null,
|
||||
@@ -265,4 +275,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
create index ix_table_from on "table" ("from");
|
||||
|
||||
@@ -9,6 +9,7 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6;
|
||||
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
|
||||
drop index if exists ix_migtest_e_basic_indextest1;
|
||||
drop index if exists ix_migtest_e_basic_indextest5;
|
||||
drop index if exists ix_migtest_quoted_status1;
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer generated by default as identity not null,
|
||||
|
||||
@@ -14,5 +14,6 @@ alter table migtest_e_history2_history drop column obsolete_string2;
|
||||
-- apply post alter
|
||||
create view migtest_e_history2_with_history as select * from migtest_e_history2 union all select * from migtest_e_history2_history;
|
||||
create trigger migtest_e_history2_history_upd before update,delete on migtest_e_history2 for each row call "io.ebean.config.dbplatform.h2.H2HistoryTrigger";
|
||||
drop table if exists "migtest_QuOtEd";
|
||||
drop table if exists migtest_e_ref;
|
||||
drop sequence if exists migtest_e_ref_seq;
|
||||
|
||||
@@ -17,6 +17,16 @@ alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_stat
|
||||
drop index if exists ix_migtest_e_basic_indextest3;
|
||||
drop index if exists ix_migtest_e_basic_indextest6;
|
||||
-- apply changes
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
name varchar(127) not null,
|
||||
@@ -95,3 +105,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-1179806373, 1.0__initial.sql
|
||||
398205555, 1.1.sql
|
||||
-1366392410, 1.2__dropsFor_1.1.sql
|
||||
-523874424, 1.3.sql
|
||||
-1826073043, 1.0__initial.sql
|
||||
-132538485, 1.1.sql
|
||||
-2064267391, 1.2__dropsFor_1.1.sql
|
||||
-94686510, 1.3.sql
|
||||
-1382108238, 1.4__dropsFor_1.3.sql
|
||||
783227075, R__multi_comments.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
@@ -127,6 +127,16 @@ create column table migtest_e_history6 (
|
||||
constraint pk_migtest_e_history6 primary key (id)
|
||||
);
|
||||
|
||||
create column table "migtest_QuOtEd" (
|
||||
id nvarchar(255) not null,
|
||||
status1 nvarchar(1),
|
||||
status2 nvarchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create column table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
name nvarchar(127) not null,
|
||||
@@ -271,4 +281,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
|
||||
|
||||
-- explicit index "ix_migtest_e_basic_indextest1" for single column "indextest1" of table "migtest_e_basic" is not necessary;
|
||||
-- explicit index "ix_migtest_e_basic_indextest5" for single column "indextest5" of table "migtest_e_basic" is not necessary;
|
||||
-- explicit index "ix_migtest_quoted_status1" for single column "status1" of table ""migtest_QuOtEd"" is not necessary;
|
||||
-- explicit index "ix_table_from" for single column ""from"" of table ""table"" is not necessary;
|
||||
|
||||
@@ -51,6 +51,13 @@ declare exit handler for sql_error_code 261 begin end;
|
||||
exec 'drop index ix_migtest_e_basic_indextest5';
|
||||
end;
|
||||
$$;
|
||||
delimiter $$
|
||||
do
|
||||
begin
|
||||
declare exit handler for sql_error_code 261 begin end;
|
||||
exec 'drop index ix_migtest_quoted_status1';
|
||||
end;
|
||||
$$;
|
||||
-- apply changes
|
||||
create column table migtest_e_user (
|
||||
id integer generated by default as identity not null,
|
||||
|
||||
@@ -12,4 +12,5 @@ CALL usp_ebean_drop_column('migtest_e_history2_history', 'obsolete_string1');
|
||||
CALL usp_ebean_drop_column('migtest_e_history2_history', 'obsolete_string2');
|
||||
-- apply post alter
|
||||
alter table migtest_e_history2 add system versioning history table migtest_e_history2_history not validated;
|
||||
drop table "migtest_QuOtEd" cascade;
|
||||
drop table migtest_e_ref cascade;
|
||||
|
||||
@@ -77,6 +77,16 @@ exec 'drop index ix_migtest_e_basic_indextest6';
|
||||
end;
|
||||
$$;
|
||||
-- apply changes
|
||||
create column table "migtest_QuOtEd" (
|
||||
id nvarchar(255) not null,
|
||||
status1 nvarchar(1),
|
||||
status2 nvarchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create column table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
name nvarchar(127) not null,
|
||||
@@ -141,3 +151,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
|
||||
|
||||
-- explicit index "ix_migtest_e_basic_indextest1" for single column "indextest1" of table "migtest_e_basic" is not necessary;
|
||||
-- explicit index "ix_migtest_e_basic_indextest5" for single column "indextest5" of table "migtest_e_basic" is not necessary;
|
||||
-- explicit index "ix_migtest_quoted_status1" for single column "status1" of table ""migtest_QuOtEd"" is not necessary;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
-745347271, I__create_procs.sql
|
||||
1934891896, 1.0__initial.sql
|
||||
187688059, 1.1.sql
|
||||
197547825, 1.2__dropsFor_1.1.sql
|
||||
-1989736027, 1.3.sql
|
||||
1631114894, 1.0__initial.sql
|
||||
-1483493637, 1.1.sql
|
||||
1535221752, 1.2__dropsFor_1.1.sql
|
||||
483907844, 1.3.sql
|
||||
1812245353, 1.4__dropsFor_1.3.sql
|
||||
1906063401, R__order_views_hana.sql
|
||||
|
||||
|
||||
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
|
||||
constraint pk_migtest_e_history6 primary key (id)
|
||||
);
|
||||
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity (start with 1) not null,
|
||||
name varchar(127) not null,
|
||||
@@ -191,4 +201,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
create index ix_table_from on "table" ("from");
|
||||
|
||||
@@ -9,6 +9,7 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6;
|
||||
alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_status;
|
||||
drop index if exists ix_migtest_e_basic_indextest1;
|
||||
drop index if exists ix_migtest_e_basic_indextest5;
|
||||
drop index if exists ix_migtest_quoted_status1;
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer generated by default as identity (start with 1) not null,
|
||||
|
||||
@@ -7,5 +7,6 @@ alter table migtest_e_basic drop column eref_id;
|
||||
alter table migtest_e_history2 drop column obsolete_string1;
|
||||
alter table migtest_e_history2 drop column obsolete_string2;
|
||||
-- apply post alter
|
||||
drop table if exists "migtest_QuOtEd";
|
||||
drop table if exists migtest_e_ref;
|
||||
drop sequence if exists migtest_e_ref_seq;
|
||||
|
||||
@@ -17,6 +17,16 @@ alter table migtest_e_enum drop constraint if exists ck_migtest_e_enum_test_stat
|
||||
drop index if exists ix_migtest_e_basic_indextest3;
|
||||
drop index if exists ix_migtest_e_basic_indextest6;
|
||||
-- apply changes
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity (start with 1) not null,
|
||||
name varchar(127) not null,
|
||||
@@ -74,3 +84,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
-917796012, 1.0__initial.sql
|
||||
-838725141, 1.1.sql
|
||||
-300925212, 1.2__dropsFor_1.1.sql
|
||||
-1549893170, 1.3.sql
|
||||
-906026927, 1.0__initial.sql
|
||||
135699844, 1.1.sql
|
||||
-848622216, 1.2__dropsFor_1.1.sql
|
||||
781720387, 1.3.sql
|
||||
-972999284, 1.4__dropsFor_1.3.sql
|
||||
861001272, R__order_views_hsqldb.sql
|
||||
|
||||
|
||||
+9
@@ -124,6 +124,14 @@ create table migtest_e_history6 (
|
||||
constraint pk_migtest_e_history6 primary key (id)
|
||||
);
|
||||
|
||||
create table `migtest_QuOtEd` (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer auto_increment not null,
|
||||
name varchar(127) not null,
|
||||
@@ -194,4 +202,5 @@ alter table `table` add constraint fk_table_foreign foreign key (`foreign`) refe
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
|
||||
create index ix_table_from on `table` (`from`);
|
||||
|
||||
@@ -6,6 +6,7 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_indextest2;
|
||||
alter table migtest_e_basic drop index uq_migtest_e_basic_indextest6;
|
||||
drop index ix_migtest_e_basic_indextest1 on migtest_e_basic;
|
||||
drop index ix_migtest_e_basic_indextest5 on migtest_e_basic;
|
||||
drop index ix_migtest_quoted_status1 on `migtest_QuOtEd`;
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer auto_increment not null,
|
||||
|
||||
+1
@@ -9,5 +9,6 @@ alter table migtest_e_basic drop column eref_id;
|
||||
alter table migtest_e_history2 drop column obsolete_string1;
|
||||
alter table migtest_e_history2 drop column obsolete_string2;
|
||||
-- apply post alter
|
||||
drop table if exists `migtest_QuOtEd`;
|
||||
drop table if exists migtest_e_ref;
|
||||
drop sequence if exists migtest_e_ref_seq;
|
||||
|
||||
@@ -14,6 +14,14 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_indextest5;
|
||||
drop index ix_migtest_e_basic_indextest3 on migtest_e_basic;
|
||||
drop index ix_migtest_e_basic_indextest6 on migtest_e_basic;
|
||||
-- apply changes
|
||||
create table `migtest_QuOtEd` (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer auto_increment not null,
|
||||
name varchar(127) not null,
|
||||
@@ -58,3 +66,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
675320779, 1.0__initial.sql
|
||||
840323734, 1.1.sql
|
||||
-828985759, 1.2__dropsFor_1.1.sql
|
||||
-1470028617, 1.3.sql
|
||||
168258180, 1.0__initial.sql
|
||||
-1449201260, 1.1.sql
|
||||
919151678, 1.2__dropsFor_1.1.sql
|
||||
-1031408459, 1.3.sql
|
||||
-446860935, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -124,6 +124,14 @@ create table migtest_e_history6 (
|
||||
constraint pk_migtest_e_history6 primary key (id)
|
||||
);
|
||||
|
||||
create table `migtest_QuOtEd` (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer auto_increment not null,
|
||||
name varchar(127) not null,
|
||||
@@ -194,4 +202,5 @@ alter table `table` add constraint fk_table_foreign foreign key (`foreign`) refe
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
|
||||
create index ix_table_from on `table` (`from`);
|
||||
|
||||
@@ -6,6 +6,7 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_indextest2;
|
||||
alter table migtest_e_basic drop index uq_migtest_e_basic_indextest6;
|
||||
drop index ix_migtest_e_basic_indextest1 on migtest_e_basic;
|
||||
drop index ix_migtest_e_basic_indextest5 on migtest_e_basic;
|
||||
drop index ix_migtest_quoted_status1 on `migtest_QuOtEd`;
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer auto_increment not null,
|
||||
|
||||
@@ -9,5 +9,6 @@ CALL usp_ebean_drop_column('migtest_e_basic', 'eref_id');
|
||||
CALL usp_ebean_drop_column('migtest_e_history2', 'obsolete_string1');
|
||||
CALL usp_ebean_drop_column('migtest_e_history2', 'obsolete_string2');
|
||||
-- apply post alter
|
||||
drop table if exists `migtest_QuOtEd`;
|
||||
drop table if exists migtest_e_ref;
|
||||
drop sequence if exists migtest_e_ref_seq;
|
||||
|
||||
@@ -14,6 +14,14 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_indextest5;
|
||||
drop index ix_migtest_e_basic_indextest3 on migtest_e_basic;
|
||||
drop index ix_migtest_e_basic_indextest6 on migtest_e_basic;
|
||||
-- apply changes
|
||||
create table `migtest_QuOtEd` (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer auto_increment not null,
|
||||
name varchar(127) not null,
|
||||
@@ -58,3 +66,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
|
||||
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
1835064798, I__create_procs.sql
|
||||
675320779, 1.0__initial.sql
|
||||
840323734, 1.1.sql
|
||||
2123392915, 1.2__dropsFor_1.1.sql
|
||||
-1470028617, 1.3.sql
|
||||
168258180, 1.0__initial.sql
|
||||
-1449201260, 1.1.sql
|
||||
1187950993, 1.2__dropsFor_1.1.sql
|
||||
-1031408459, 1.3.sql
|
||||
-692020559, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -91,6 +91,12 @@
|
||||
<column name="test_number1" type="integer"/>
|
||||
<column name="test_number2" type="integer" notnull="true"/>
|
||||
</createTable>
|
||||
<createTable name=""migtest_QuOtEd"" 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">
|
||||
<column name="id" type="integer" primaryKey="true"/>
|
||||
<column name="name" type="varchar(127)" notnull="true"/>
|
||||
@@ -127,6 +133,7 @@
|
||||
</createTable>
|
||||
<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_quoted_status1" tableName=""migtest_QuOtEd"" columns="status1"/>
|
||||
<createIndex indexName="ix_table_from" tableName=""table"" columns=""from""/>
|
||||
<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"/>
|
||||
|
||||
@@ -106,6 +106,7 @@
|
||||
<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_indextest5" tableName="migtest_e_basic"/>
|
||||
<dropIndex indexName="ix_migtest_quoted_status1" tableName=""migtest_QuOtEd""/>
|
||||
<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" tableName="migtest_oto_child" platforms="POSTGRES"/>
|
||||
@@ -117,6 +118,7 @@
|
||||
<dropColumn columnName="eref_id" tableName="migtest_e_basic"/>
|
||||
<dropColumn columnName="obsolete_string1" tableName="migtest_e_history2" withHistory="true"/>
|
||||
<dropColumn columnName="obsolete_string2" tableName="migtest_e_history2" withHistory="true"/>
|
||||
<dropTable name=""migtest_QuOtEd""/>
|
||||
<dropTable name="migtest_e_ref" sequenceCol="id"/>
|
||||
</changeSet>
|
||||
</migration>
|
||||
+1
@@ -7,6 +7,7 @@
|
||||
<dropColumn columnName="eref_id" tableName="migtest_e_basic"/>
|
||||
<dropColumn columnName="obsolete_string1" tableName="migtest_e_history2" withHistory="true"/>
|
||||
<dropColumn columnName="obsolete_string2" tableName="migtest_e_history2" withHistory="true"/>
|
||||
<dropTable name=""migtest_QuOtEd""/>
|
||||
<dropTable name="migtest_e_ref" sequenceCol="id"/>
|
||||
</changeSet>
|
||||
</migration>
|
||||
@@ -35,6 +35,12 @@
|
||||
<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_number2" tableName="migtest_e_history6" withHistory="true" currentType="integer" defaultValue="7" notnull="true" currentNotnull="false"/>
|
||||
<createTable name=""migtest_QuOtEd"" 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">
|
||||
<column name="id" type="integer" primaryKey="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"/>
|
||||
<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_quoted_status1" tableName=""migtest_QuOtEd"" columns="status1"/>
|
||||
<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="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)
|
||||
);
|
||||
|
||||
create table `migtest_QuOtEd` (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer auto_increment not null,
|
||||
name varchar(127) not null,
|
||||
@@ -321,4 +329,5 @@ alter table `table` add constraint fk_table_foreign foreign key (`foreign`) refe
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
|
||||
create index ix_table_from on `table` (`from`);
|
||||
|
||||
@@ -6,6 +6,7 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_indextest2;
|
||||
alter table migtest_e_basic drop index uq_migtest_e_basic_indextest6;
|
||||
drop index ix_migtest_e_basic_indextest1 on migtest_e_basic;
|
||||
drop index ix_migtest_e_basic_indextest5 on migtest_e_basic;
|
||||
drop index ix_migtest_quoted_status1 on `migtest_QuOtEd`;
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer auto_increment not null,
|
||||
|
||||
@@ -25,4 +25,5 @@ create trigger migtest_e_history2_history_del before delete on migtest_e_history
|
||||
insert into migtest_e_history2_history (sys_period_start,sys_period_end,id, test_string, test_string3, new_column) values (OLD.sys_period_start, now(6),OLD.id, OLD.test_string, OLD.test_string3, OLD.new_column);
|
||||
end$$
|
||||
unlock tables;
|
||||
drop table if exists `migtest_QuOtEd`;
|
||||
drop table if exists migtest_e_ref;
|
||||
|
||||
@@ -14,6 +14,14 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_indextest5;
|
||||
drop index ix_migtest_e_basic_indextest3 on migtest_e_basic;
|
||||
drop index ix_migtest_e_basic_indextest6 on migtest_e_basic;
|
||||
-- apply changes
|
||||
create table `migtest_QuOtEd` (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer auto_increment not null,
|
||||
name varchar(127) not null,
|
||||
@@ -124,5 +132,6 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
|
||||
create index ix_m12_otoc72 on migtest_oto_child (name);
|
||||
create index ix_migtest_oto_master_name on migtest_oto_master (name);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
1835064798, I__create_procs.sql
|
||||
1464726622, 1.0__initial.sql
|
||||
1321178229, 1.1.sql
|
||||
-1332434945, 1.2__dropsFor_1.1.sql
|
||||
-105506677, 1.3.sql
|
||||
-1894322966, 1.0__initial.sql
|
||||
718635669, 1.1.sql
|
||||
-1097227916, 1.2__dropsFor_1.1.sql
|
||||
-1972055805, 1.3.sql
|
||||
379252952, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -124,6 +124,14 @@ create table migtest_e_history6 (
|
||||
constraint pk_migtest_e_history6 primary key (id)
|
||||
);
|
||||
|
||||
create table `migtest_QuOtEd` (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer auto_increment not null,
|
||||
name varchar(127) not null,
|
||||
@@ -321,4 +329,5 @@ alter table `table` add constraint fk_table_foreign foreign key (`foreign`) refe
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
|
||||
create index ix_table_from on `table` (`from`);
|
||||
|
||||
@@ -6,6 +6,7 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_indextest2;
|
||||
alter table migtest_e_basic drop index uq_migtest_e_basic_indextest6;
|
||||
drop index ix_migtest_e_basic_indextest1 on migtest_e_basic;
|
||||
drop index ix_migtest_e_basic_indextest5 on migtest_e_basic;
|
||||
drop index ix_migtest_quoted_status1 on `migtest_QuOtEd`;
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer auto_increment not null,
|
||||
|
||||
@@ -25,4 +25,5 @@ create trigger migtest_e_history2_history_del before delete on migtest_e_history
|
||||
insert into migtest_e_history2_history (sys_period_start,sys_period_end,id, test_string, test_string3, new_column) values (OLD.sys_period_start, now(6),OLD.id, OLD.test_string, OLD.test_string3, OLD.new_column);
|
||||
end$$
|
||||
unlock tables;
|
||||
drop table if exists `migtest_QuOtEd`;
|
||||
drop table if exists migtest_e_ref;
|
||||
|
||||
@@ -14,6 +14,14 @@ alter table migtest_e_basic drop index uq_migtest_e_basic_indextest5;
|
||||
drop index ix_migtest_e_basic_indextest3 on migtest_e_basic;
|
||||
drop index ix_migtest_e_basic_indextest6 on migtest_e_basic;
|
||||
-- apply changes
|
||||
create table `migtest_QuOtEd` (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer auto_increment not null,
|
||||
name varchar(127) not null,
|
||||
@@ -124,5 +132,6 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on `migtest_QuOtEd` (status1);
|
||||
create index ix_m12_otoc72 on migtest_oto_child (name);
|
||||
create index ix_migtest_oto_master_name on migtest_oto_master (name);
|
||||
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
1835064798, I__create_procs.sql
|
||||
782176262, 1.0__initial.sql
|
||||
1321178229, 1.1.sql
|
||||
-1332434945, 1.2__dropsFor_1.1.sql
|
||||
-105506677, 1.3.sql
|
||||
955526296, 1.0__initial.sql
|
||||
718635669, 1.1.sql
|
||||
-1097227916, 1.2__dropsFor_1.1.sql
|
||||
-1972055805, 1.3.sql
|
||||
379252952, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
|
||||
constraint pk_migtest_e_history6 primary key (id)
|
||||
);
|
||||
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
name varchar(127) not null,
|
||||
@@ -336,4 +346,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
create index ix_table_from on "table" ("from");
|
||||
|
||||
@@ -9,6 +9,7 @@ alter table migtest_e_basic drop constraint uq_migtest_e_basic_indextest6;
|
||||
alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status;
|
||||
drop index if exists ix_migtest_e_basic_indextest1;
|
||||
drop index if exists ix_migtest_e_basic_indextest5;
|
||||
drop index if exists ix_migtest_quoted_status1;
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id integer generated by default as identity not null,
|
||||
|
||||
@@ -27,5 +27,6 @@ create or replace trigger migtest_e_history2_history_del for migtest_e_history2
|
||||
end_trigger;
|
||||
$$
|
||||
|
||||
drop table if exists "migtest_QuOtEd";
|
||||
drop table if exists migtest_e_ref;
|
||||
drop sequence if exists migtest_e_ref_seq;
|
||||
|
||||
@@ -17,6 +17,16 @@ alter table migtest_e_enum drop constraint ck_migtest_e_enum_test_status;
|
||||
drop index if exists ix_migtest_e_basic_indextest3;
|
||||
drop index if exists ix_migtest_e_basic_indextest6;
|
||||
-- apply changes
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar(255) not null,
|
||||
status1 varchar(1),
|
||||
status2 varchar(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id integer generated by default as identity not null,
|
||||
name varchar(127) not null,
|
||||
@@ -144,3 +154,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-357978944, 1.0__initial.sql
|
||||
1244774121, 1.1.sql
|
||||
-424253630, 1.2__dropsFor_1.1.sql
|
||||
-1988156517, 1.3.sql
|
||||
-355978970, 1.0__initial.sql
|
||||
-1099441011, 1.1.sql
|
||||
1530685455, 1.2__dropsFor_1.1.sql
|
||||
1263834751, 1.3.sql
|
||||
-1189704269, 1.4__dropsFor_1.3.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
|
||||
@@ -127,6 +127,16 @@ create table migtest_e_history6 (
|
||||
constraint pk_migtest_e_history6 primary key (id)
|
||||
);
|
||||
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar2(255) not null,
|
||||
status1 varchar2(1),
|
||||
status2 varchar2(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id number(10) generated by default as identity not null,
|
||||
name varchar2(127) not null,
|
||||
@@ -191,4 +201,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
create index ix_table_from on "table" ("from");
|
||||
|
||||
@@ -54,6 +54,7 @@ end;
|
||||
$$;
|
||||
drop index ix_migtest_e_basic_indextest1;
|
||||
drop index ix_migtest_e_basic_indextest5;
|
||||
drop index ix_migtest_quoted_status1;
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id number(10) generated by default as identity not null,
|
||||
|
||||
@@ -7,6 +7,7 @@ alter table migtest_e_basic drop column eref_id;
|
||||
alter table migtest_e_history2 drop column obsolete_string1;
|
||||
alter table migtest_e_history2 drop column obsolete_string2;
|
||||
-- apply post alter
|
||||
drop table "migtest_QuOtEd" cascade constraints purge;
|
||||
drop table migtest_e_ref cascade constraints purge;
|
||||
delimiter $$
|
||||
declare
|
||||
|
||||
@@ -89,6 +89,16 @@ $$;
|
||||
drop index ix_migtest_e_basic_indextest3;
|
||||
drop index ix_migtest_e_basic_indextest6;
|
||||
-- apply changes
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar2(255) not null,
|
||||
status1 varchar2(1),
|
||||
status2 varchar2(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id number(10) generated by default as identity not null,
|
||||
name varchar2(127) not null,
|
||||
@@ -146,3 +156,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
-2071028889, 1.0__initial.sql
|
||||
-1556388339, 1.1.sql
|
||||
-582436324, 1.2__dropsFor_1.1.sql
|
||||
-712179623, 1.3.sql
|
||||
1374133214, 1.0__initial.sql
|
||||
-1429935878, 1.1.sql
|
||||
930172034, 1.2__dropsFor_1.1.sql
|
||||
-1621367223, 1.3.sql
|
||||
663051206, 1.4__dropsFor_1.3.sql
|
||||
1357801733, R__oracle_only_views.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
@@ -143,6 +143,16 @@ create table migtest_e_history6 (
|
||||
);
|
||||
create sequence migtest_e_history6_seq;
|
||||
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar2(255) not null,
|
||||
status1 varchar2(1),
|
||||
status2 varchar2(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id number(10) not null,
|
||||
name varchar2(127) not null,
|
||||
@@ -213,4 +223,5 @@ alter table "table" add constraint fk_table_foreign foreign key ("foreign") refe
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
create index ix_table_from on "table" ("from");
|
||||
|
||||
@@ -54,6 +54,7 @@ end;
|
||||
$$;
|
||||
drop index ix_migtest_e_basic_indextest1;
|
||||
drop index ix_migtest_e_basic_indextest5;
|
||||
drop index ix_migtest_quoted_status1;
|
||||
-- apply changes
|
||||
create table migtest_e_user (
|
||||
id number(10) not null,
|
||||
|
||||
@@ -7,6 +7,7 @@ alter table migtest_e_basic drop column eref_id;
|
||||
alter table migtest_e_history2 drop column obsolete_string1;
|
||||
alter table migtest_e_history2 drop column obsolete_string2;
|
||||
-- apply post alter
|
||||
drop table "migtest_QuOtEd" cascade constraints purge;
|
||||
drop table migtest_e_ref cascade constraints purge;
|
||||
delimiter $$
|
||||
declare
|
||||
|
||||
@@ -89,6 +89,16 @@ $$;
|
||||
drop index ix_migtest_e_basic_indextest3;
|
||||
drop index ix_migtest_e_basic_indextest6;
|
||||
-- apply changes
|
||||
create table "migtest_QuOtEd" (
|
||||
id varchar2(255) not null,
|
||||
status1 varchar2(1),
|
||||
status2 varchar2(1),
|
||||
constraint ck_migtest_quoted_status1 check ( status1 in ('N','A','I')),
|
||||
constraint ck_migtest_quoted_status2 check ( status2 in ('N','A','I')),
|
||||
constraint uq_migtest_quoted_status2 unique (status2),
|
||||
constraint pk_migtest_quoted primary key (id)
|
||||
);
|
||||
|
||||
create table migtest_e_ref (
|
||||
id number(10) not null,
|
||||
name varchar2(127) not null,
|
||||
@@ -147,3 +157,4 @@ alter table migtest_e_basic add constraint fk_migtest_e_basic_eref_id foreign ke
|
||||
|
||||
create index ix_migtest_e_basic_indextest1 on migtest_e_basic (indextest1);
|
||||
create index ix_migtest_e_basic_indextest5 on migtest_e_basic (indextest5);
|
||||
create index ix_migtest_quoted_status1 on "migtest_QuOtEd" (status1);
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
-1110489114, 1.0__initial.sql
|
||||
1800537955, 1.1.sql
|
||||
-582436324, 1.2__dropsFor_1.1.sql
|
||||
-253819510, 1.3.sql
|
||||
1070168506, 1.0__initial.sql
|
||||
984602561, 1.1.sql
|
||||
930172034, 1.2__dropsFor_1.1.sql
|
||||
-144959080, 1.3.sql
|
||||
663051206, 1.4__dropsFor_1.3.sql
|
||||
1357801733, R__oracle_only_views.sql
|
||||
561281075, R__order_views.sql
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user