diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java index 0dc6445d94a..df7bd3f2941 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTask.java @@ -137,7 +137,7 @@ public class AddIndexTask extends BaseTableTask { postgresOnline = "CONCURRENTLY "; break; case ORACLE_12C: - oracleOnlineDeferred = " ONLINE DEFERRED"; + oracleOnlineDeferred = " ONLINE DEFERRED INVALIDATION"; break; case MSSQL_2012: oracleOnlineDeferred = " WITH (ONLINE = ON)"; diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java index 679db139ad3..4a45ebffe5a 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTask.java @@ -112,7 +112,7 @@ public class DropIndexTask extends BaseTableTask { sql.add("drop index " + myIndexName + (myOnline?" ONLINE":"")); break; case MSSQL_2012: - sql.add("drop index " + getTableName() + "." + myIndexName + (myOnline?" WITH (ONLINE = ON)":"")); + sql.add("drop index " + getTableName() + "." + myIndexName ); break; } } diff --git a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTest.java b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTest.java index 75d2d0cbe0d..cf91e60092e 100644 --- a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTest.java +++ b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/AddIndexTest.java @@ -177,7 +177,7 @@ public class AddIndexTest extends BaseTest { assertEquals("create index CONCURRENTLY IDX_ANINDEX on SOMETABLE(PID, TEXTCOL)", mySql); break; case ORACLE_12C: - assertEquals("create index IDX_ANINDEX on SOMETABLE(PID, TEXTCOL) ONLINE DEFERRED", mySql); + assertEquals("create index IDX_ANINDEX on SOMETABLE(PID, TEXTCOL) ONLINE DEFERRED INVALIDATION", mySql); break; case MSSQL_2012: assertEquals("create index IDX_ANINDEX on SOMETABLE(PID, TEXTCOL) WITH (ONLINE = ON)", mySql); diff --git a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTest.java b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTest.java index 3eabdf26c8f..9b156e3fa56 100644 --- a/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTest.java +++ b/hapi-fhir-sql-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/DropIndexTest.java @@ -9,7 +9,6 @@ import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.MethodSource; import java.sql.SQLException; -import java.util.Arrays; import java.util.List; import java.util.function.Supplier; @@ -18,9 +17,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.not; -import static org.junit.jupiter.api.Assertions.assertEquals; public class DropIndexTest extends BaseTest { @@ -245,7 +242,7 @@ public class DropIndexTest extends BaseTest { assertThat(mySql, equalTo(asList("drop index IDX_ANINDEX ONLINE"))); break; case MSSQL_2012: - assertThat(mySql, equalTo(asList("drop index SOMETABLE.IDX_ANINDEX WITH (ONLINE = ON)"))); + assertThat(mySql, equalTo(asList("drop index SOMETABLE.IDX_ANINDEX"))); break; case POSTGRES_9_4: assertThat(mySql, equalTo(asList("drop index CONCURRENTLY IDX_ANINDEX")));