From ef77490c5139801d7dc1d6667bcbdf66e933de48 Mon Sep 17 00:00:00 2001 From: Ken Stevens Date: Tue, 26 Nov 2019 09:50:40 -0500 Subject: [PATCH] fix test --- .../src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java | 2 +- .../test/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTest.java | 5 +++-- src/changes/changes.xml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java index f992d08cb5d..0a0ea8154c0 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/JdbcUtils.java @@ -441,7 +441,7 @@ public class JdbcUtils { if ("SYSTEM TABLE".equalsIgnoreCase(tableType)) { continue; } - if ("FLYWAY_SCHEMA_HISTORY".equalsIgnoreCase(tableName)) { + if (SchemaMigrator.HAPI_FHIR_MIGRATION_TABLENAME.equalsIgnoreCase(tableName)) { continue; } diff --git a/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTest.java b/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTest.java index 8cea316944f..e425288ce8a 100644 --- a/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTest.java +++ b/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/BaseTest.java @@ -3,6 +3,7 @@ package ca.uhn.fhir.jpa.migrate.taskdef; import ca.uhn.fhir.jpa.migrate.DriverTypeEnum; import ca.uhn.fhir.jpa.migrate.FlywayMigrator; import ca.uhn.fhir.jpa.migrate.JdbcUtils; +import ca.uhn.fhir.jpa.migrate.SchemaMigrator; import org.apache.commons.dbcp2.BasicDataSource; import org.intellij.lang.annotations.Language; import org.junit.After; @@ -51,8 +52,8 @@ public class BaseTest { @After public void resetMigrationVersion() throws SQLException { Set tableNames = JdbcUtils.getTableNames(getConnectionProperties()); - if (tableNames.contains("flyway_schema_history")) { - executeSql("DELETE from \"flyway_schema_history\" where \"installed_rank\" > 0"); + if (tableNames.contains(SchemaMigrator.HAPI_FHIR_MIGRATION_TABLENAME)) { + executeSql("DELETE from " + SchemaMigrator.HAPI_FHIR_MIGRATION_TABLENAME + " where \"installed_rank\" > 0"); } } diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 08ddac2c5eb..db172b7738c 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -42,7 +42,7 @@ the JPA server. - Changed database migration to use flyway. This adds a new table called flyway_schema_history that records all + Changed database migration to use flyway. This adds a new table called FLY_HFJ_MIGRATION that records all database migration tasks that have already been applied. The hapi-fhir-cli migrate tool has been changed to use flyway. Learn more about flyway on https://flywaydb.org/.