From deb5fd40a75debf50bedda74299b4ead71a59dd6 Mon Sep 17 00:00:00 2001 From: Ken Stevens Date: Mon, 9 Dec 2019 14:42:37 -0500 Subject: [PATCH] Added stubbed tasks for add and drop index --- .../jpa/migrate/taskdef/AddColumnTask.java | 2 +- .../migrate/taskdef/AddForeignKeyTask.java | 2 +- .../migrate/taskdef/AddIdGeneratorTask.java | 2 +- .../jpa/migrate/taskdef/AddIndexTask.java | 2 +- .../migrate/taskdef/AddTableByColumnTask.java | 2 +- .../migrate/taskdef/AddTableRawSqlTask.java | 2 +- .../jpa/migrate/taskdef/ArbitrarySqlTask.java | 2 +- .../fhir/jpa/migrate/taskdef/BaseTask.java | 21 +++++++++++++++++-- .../migrate/taskdef/CalculateHashesTask.java | 2 +- .../jpa/migrate/taskdef/DropColumnTask.java | 2 +- .../migrate/taskdef/DropForeignKeyTask.java | 2 +- .../migrate/taskdef/DropIdGeneratorTask.java | 2 +- .../jpa/migrate/taskdef/DropIndexTask.java | 2 +- .../jpa/migrate/taskdef/DropTableTask.java | 2 +- .../migrate/taskdef/ExecuteRawSqlTask.java | 2 +- .../migrate/taskdef/InitializeSchemaTask.java | 2 +- .../jpa/migrate/taskdef/ModifyColumnTask.java | 2 +- .../jpa/migrate/taskdef/RenameColumnTask.java | 2 +- .../fhir/jpa/migrate/tasks/api/Builder.java | 20 ++++++++++++++++++ .../taskdef/AddTableByColumnTaskTest.java | 17 +++++++++++---- 20 files changed, 69 insertions(+), 23 deletions(-) diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTask.java index 7af47f1ce08..f9e73700311 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddColumnTask.java @@ -42,7 +42,7 @@ public class AddColumnTask extends BaseTableColumnTypeTask { } @Override - public void execute() throws SQLException { + public void doExecute() throws SQLException { Set columnNames = JdbcUtils.getColumnNames(getConnectionProperties(), getTableName()); if (columnNames.contains(getColumnName())) { logInfo(ourLog, "Column {} already exists on table {} - No action performed", getColumnName(), getTableName()); diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddForeignKeyTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddForeignKeyTask.java index eea21b2ef6a..c4dba638a0b 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddForeignKeyTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddForeignKeyTask.java @@ -66,7 +66,7 @@ public class AddForeignKeyTask extends BaseTableColumnTask { } @Override - public void execute() throws SQLException { + public void doExecute() throws SQLException { Set existing = JdbcUtils.getForeignKeys(getConnectionProperties(), myForeignTableName, getTableName()); if (existing.contains(myConstraintName)) { diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIdGeneratorTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIdGeneratorTask.java index 60f9e527a8e..d293174290d 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIdGeneratorTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIdGeneratorTask.java @@ -50,7 +50,7 @@ public class AddIdGeneratorTask extends BaseTask { } @Override - public void execute() throws SQLException { + public void doExecute() throws SQLException { Set tableNames = JdbcUtils.getTableNames(getConnectionProperties()); String sql = null; diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java index add63a1537d..f634c782db9 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java @@ -67,7 +67,7 @@ public class AddIndexTask extends BaseTableTask { } @Override - public void execute() throws SQLException { + public void doExecute() throws SQLException { Set indexNames = JdbcUtils.getIndexNames(getConnectionProperties(), getTableName()); if (indexNames.contains(myIndexName)) { logInfo(ourLog, "Index {} already exists on table {} - No action performed", myIndexName, getTableName()); diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTask.java index 7b41e92668e..38cec37bd74 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTask.java @@ -58,7 +58,7 @@ public class AddTableByColumnTask extends BaseTableTask { } @Override - public void execute() throws SQLException { + public void doExecute() throws SQLException { if (JdbcUtils.getTableNames(getConnectionProperties()).contains(getTableName())) { logInfo(ourLog, "Already have table named {} - No action performed", getTableName()); diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableRawSqlTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableRawSqlTask.java index f67f3628ee1..65f241aae91 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableRawSqlTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableRawSqlTask.java @@ -58,7 +58,7 @@ public class AddTableRawSqlTask extends BaseTableTask { } @Override - public void execute() throws SQLException { + public void doExecute() throws SQLException { Set tableNames = JdbcUtils.getTableNames(getConnectionProperties()); if (tableNames.contains(getTableName())) { logInfo(ourLog, "Table {} already exists - No action performed", getTableName()); diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ArbitrarySqlTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ArbitrarySqlTask.java index 108d35e6960..2d9170b8637 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ArbitrarySqlTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ArbitrarySqlTask.java @@ -63,7 +63,7 @@ public class ArbitrarySqlTask extends BaseTask { } @Override - public void execute() throws SQLException { + public void doExecute() throws SQLException { logInfo(ourLog, "Starting: {}", myDescription); if (StringUtils.isNotBlank(myExecuteOnlyIfTableExists)) { diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTask.java index f05ec1beae4..e74dacadb34 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTask.java @@ -25,7 +25,6 @@ import org.intellij.lang.annotations.Language; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.dao.DataAccessException; -import org.springframework.dao.DataIntegrityViolationException; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.transaction.support.TransactionTemplate; @@ -47,6 +46,7 @@ public abstract class BaseTask { private String myDescription; private int myChangesCount; private boolean myDryRun; + private boolean myDoNothing; private List myExecutedStatements = new ArrayList<>(); private boolean myNoColumnShrink; private boolean myFailureAllowed; @@ -155,7 +155,15 @@ public abstract class BaseTask { return getConnectionProperties().newJdbcTemplate(); } - public abstract void execute() throws SQLException; + public void execute() throws SQLException { + if (myDoNothing) { + ourLog.info("Skipping stubbed task: {}", getDescription()); + return; + } + doExecute(); + } + + public abstract void doExecute() throws SQLException; public void setFailureAllowed(boolean theFailureAllowed) { myFailureAllowed = theFailureAllowed; @@ -180,6 +188,15 @@ public abstract class BaseTask { } } + public boolean isDoNothing() { + return myDoNothing; + } + + public BaseTask setDoNothing(boolean theDoNothing) { + myDoNothing = theDoNothing; + return this; + } + public static class ExecutedStatement { private final String mySql; private final List myArguments; diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/CalculateHashesTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/CalculateHashesTask.java index 939a479f336..75ef31a94a2 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/CalculateHashesTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/CalculateHashesTask.java @@ -58,7 +58,7 @@ public class CalculateHashesTask extends BaseTableColumnTask { } @Override - public void execute() throws SQLException { + public void doExecute() throws SQLException { Set columnNames = JdbcUtils.getColumnNames(getConnectionProperties(), getTableName()); if (!columnNames.contains(getColumnName())) { logInfo(ourLog, "Column {} does not exist on table {} - No action performed", getColumnName(), getTableName()); diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropForeignKeyTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropForeignKeyTask.java index 6b08912b6f8..0fe92666b69 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropForeignKeyTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropForeignKeyTask.java @@ -65,7 +65,7 @@ public class DropForeignKeyTask extends BaseTableTask { } @Override - public void execute() throws SQLException { + public void doExecute() throws SQLException { Set existing = JdbcUtils.getForeignKeys(getConnectionProperties(), myParentTableName, getTableName()); if (!existing.contains(myConstraintName)) { diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIdGeneratorTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIdGeneratorTask.java index dca3b8b195e..dccce05f45f 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIdGeneratorTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIdGeneratorTask.java @@ -50,7 +50,7 @@ public class DropIdGeneratorTask extends BaseTask { } @Override - public void execute() throws SQLException { + public void doExecute() throws SQLException { Set tableNames = JdbcUtils.getTableNames(getConnectionProperties()); String sql = null; diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java index 9f44c48d1e6..21b80a972d3 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java @@ -53,7 +53,7 @@ public class DropIndexTask extends BaseTableTask { } @Override - public void execute() throws SQLException { + public void doExecute() throws SQLException { Set indexNames = JdbcUtils.getIndexNames(getConnectionProperties(), getTableName()); if (!indexNames.contains(myIndexName)) { diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropTableTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropTableTask.java index 63253a7887b..a5c33b4683a 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropTableTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropTableTask.java @@ -44,7 +44,7 @@ public class DropTableTask extends BaseTableTask { } @Override - public void execute() throws SQLException { + public void doExecute() throws SQLException { Set tableNames = JdbcUtils.getTableNames(getConnectionProperties()); if (!tableNames.contains(getTableName())) { return; diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ExecuteRawSqlTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ExecuteRawSqlTask.java index da0fc07ecf6..04c06fe33ea 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ExecuteRawSqlTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ExecuteRawSqlTask.java @@ -67,7 +67,7 @@ public class ExecuteRawSqlTask extends BaseTask { } @Override - public void execute() { + public void doExecute() { List sqlStatements = myDriverToSqls.computeIfAbsent(getDriverType(), t -> new ArrayList<>()); sqlStatements.addAll(myDriverNeutralSqls); diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/InitializeSchemaTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/InitializeSchemaTask.java index 7365bd37a8d..c3b1f0832db 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/InitializeSchemaTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/InitializeSchemaTask.java @@ -48,7 +48,7 @@ public class InitializeSchemaTask extends BaseTask { } @Override - public void execute() throws SQLException { + public void doExecute() throws SQLException { DriverTypeEnum driverType = getDriverType(); Set tableNames = JdbcUtils.getTableNames(getConnectionProperties()); diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ModifyColumnTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ModifyColumnTask.java index 2b4a6264ecd..4d3c26dbafe 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ModifyColumnTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ModifyColumnTask.java @@ -43,7 +43,7 @@ public class ModifyColumnTask extends BaseTableColumnTypeTask } @Override - public void execute() throws SQLException { + public void doExecute() throws SQLException { JdbcUtils.ColumnType existingType; boolean nullable; diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/RenameColumnTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/RenameColumnTask.java index 5c21080ef43..a3c80db70da 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/RenameColumnTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/RenameColumnTask.java @@ -65,7 +65,7 @@ public class RenameColumnTask extends BaseTableTask { } @Override - public void execute() throws SQLException { + public void doExecute() throws SQLException { Set columnNames = JdbcUtils.getColumnNames(getConnectionProperties(), getTableName()); boolean haveOldName = columnNames.contains(myOldName.toUpperCase()); boolean haveNewName = columnNames.contains(myNewName.toUpperCase()); diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java index 42e0b2a9549..6ae87bd732c 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/Builder.java @@ -147,9 +147,18 @@ public class Builder { } public void dropIndex(String theVersion, String theIndexName) { + dropIndexOptional(false, theVersion, theIndexName); + } + + public void dropIndexStub(String theVersion, String theIndexName) { + dropIndexOptional(true, theVersion, theIndexName); + } + + private void dropIndexOptional(boolean theDoNothing, String theVersion, String theIndexName) { DropIndexTask task = new DropIndexTask(myRelease, theVersion); task.setIndexName(theIndexName); task.setTableName(myTableName); + task.setDoNothing(theDoNothing); addTask(task); } @@ -244,12 +253,21 @@ public class Builder { myUnique = theUnique; } + public void withColumnsStub(String... theColumnNames) { + withColumnsOptional(true, theColumnNames); + } + public void withColumns(String... theColumnNames) { + withColumnsOptional(false, theColumnNames); + } + + private void withColumnsOptional(boolean theDoNothing, String... theColumnNames) { AddIndexTask task = new AddIndexTask(myRelease, myVersion); task.setTableName(myTableName); task.setIndexName(myIndexName); task.setUnique(myUnique); task.setColumns(theColumnNames); + task.setDoNothing(theDoNothing); addTask(task); } } @@ -355,6 +373,7 @@ public class Builder { private final String myVersion; private final String myColumnName; private final BaseMigrationTasks.IAcceptsTasks myTaskSink; + private boolean myDoNothing; public BuilderAddColumnWithName(String theRelease, String theVersion, String theColumnName, BaseMigrationTasks.IAcceptsTasks theTaskSink) { myRelease = theRelease; @@ -396,6 +415,7 @@ public class Builder { } myTaskSink.addTask(task); } + } } } diff --git a/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTaskTest.java b/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTaskTest.java index 4b2ee0f79f5..8b5f91596ab 100644 --- a/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTaskTest.java +++ b/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddTableByColumnTaskTest.java @@ -7,12 +7,13 @@ import ca.uhn.fhir.util.VersionEnum; import org.junit.Test; import java.sql.SQLException; +import java.util.Set; +import java.util.stream.Collectors; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.junit.Assert.assertThat; public class AddTableByColumnTaskTest extends BaseTest { - @Test public void testAddTable() throws SQLException { @@ -21,9 +22,14 @@ public class AddTableByColumnTaskTest extends BaseTest { getMigrator().migrate(); assertThat(JdbcUtils.getTableNames(getConnectionProperties()), containsInAnyOrder("FOO_TABLE", "TGT_TABLE")); + Set indexes = JdbcUtils.getIndexNames(getConnectionProperties(), "FOO_TABLE") + .stream() + .filter(s -> !s.startsWith("FK_REF_INDEX_")) + .filter(s -> !s.startsWith("PRIMARY_KEY_")) + .collect(Collectors.toSet()); + assertThat(indexes, containsInAnyOrder("IDX_HELLO")); } - private static class MyMigrationTasks extends BaseMigrationTasks { public MyMigrationTasks() { Builder v = forVersion(VersionEnum.V3_5_0); @@ -34,10 +40,13 @@ public class AddTableByColumnTaskTest extends BaseTest { Builder.BuilderAddTableByColumns fooTable = v.addTableByColumns("3", "FOO_TABLE", "PID"); fooTable.addColumn("PID").nonNullable().type(BaseTableColumnTypeTask.ColumnTypeEnum.LONG); fooTable.addColumn("HELLO").nullable().type(BaseTableColumnTypeTask.ColumnTypeEnum.STRING, 200); + fooTable.addColumn("GOODBYE").nullable().type(BaseTableColumnTypeTask.ColumnTypeEnum.STRING, 200); fooTable.addColumn("COL_REF").nullable().type(BaseTableColumnTypeTask.ColumnTypeEnum.LONG); fooTable.addIndex("4", "IDX_HELLO").unique(true).withColumns("HELLO"); - fooTable.addForeignKey("5", "FK_REF").toColumn("COL_REF").references("TGT_TABLE", "PID"); - + // FIXME KHS add doNothing() somewhere in this builder (find the sync this is using) + fooTable.addIndex("5", "IDX_GOODBYE").unique(true).withColumnsStub("GOODBYE"); + fooTable.dropIndexStub("6", "IDX_HELLO"); + fooTable.addForeignKey("7", "FK_REF").toColumn("COL_REF").references("TGT_TABLE", "PID"); } } }