From c27dfdff5131b68315decdb2eb2ad3a085342f41 Mon Sep 17 00:00:00 2001 From: Ken Stevens Date: Mon, 2 Dec 2019 18:48:40 -0500 Subject: [PATCH] back out schema initialize naming. there may be migrated schemas in the wild this would interfere with. --- .../fhir/jpa/migrate/taskdef/InitializeSchemaTask.java | 2 +- .../jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java | 2 +- .../migrate/tasks/SchemaInitializationProvider.java | 10 +--------- .../tasks/api/ISchemaInitializationProvider.java | 2 -- .../jpa/migrate/taskdef/InitializeSchemaTaskTest.java | 5 ----- 5 files changed, 3 insertions(+), 18 deletions(-) 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 4ab392d1c6a..7365bd37a8d 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 @@ -39,7 +39,7 @@ public class InitializeSchemaTask extends BaseTask { public InitializeSchemaTask(String theProductVersion, String theSchemaVersion, ISchemaInitializationProvider theSchemaInitializationProvider) { super(theProductVersion, theSchemaVersion); mySchemaInitializationProvider = theSchemaInitializationProvider; - setDescription("Initialize schema for " + theSchemaInitializationProvider.getDescription()); + setDescription("Initialize schema"); } @Override diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java index 53fde91e047..3dde8244db4 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/HapiFhirJpaMigrationTasks.java @@ -885,7 +885,7 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks { private void init330() { // 20180114 - 20180329 Builder version = forVersion(VersionEnum.V3_3_0); - version.initializeSchema("20180115.0", new SchemaInitializationProvider("HAPI-FHIR", "/ca/uhn/hapi/fhir/jpa/docs/database", "HFJ_RESOURCE")); + version.initializeSchema("20180115.0", new SchemaInitializationProvider("/ca/uhn/hapi/fhir/jpa/docs/database", "HFJ_RESOURCE")); Builder.BuilderWithTableName hfjResource = version.onTable("HFJ_RESOURCE"); version.startSectionWithMessage("Starting work on table: " + hfjResource.getTableName()); diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/SchemaInitializationProvider.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/SchemaInitializationProvider.java index ae5bd36f785..6472bae0f33 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/SchemaInitializationProvider.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/SchemaInitializationProvider.java @@ -38,17 +38,14 @@ import java.util.regex.Pattern; import static org.apache.commons.lang3.StringUtils.isBlank; public class SchemaInitializationProvider implements ISchemaInitializationProvider { - private final String mySchemaDescription; private final String mySchemaFileClassPath; private final String mySchemaExistsIndicatorTable; /** - * @param theSchemaDescription description of the schema being updated (for logging) * @param theSchemaFileClassPath pathname to script used to initialize schema * @param theSchemaExistsIndicatorTable a table name we can use to determine if this schema has already been initialized */ - public SchemaInitializationProvider(String theSchemaDescription, String theSchemaFileClassPath, String theSchemaExistsIndicatorTable) { - mySchemaDescription = theSchemaDescription; + public SchemaInitializationProvider(String theSchemaFileClassPath, String theSchemaExistsIndicatorTable) { mySchemaFileClassPath = theSchemaFileClassPath; mySchemaExistsIndicatorTable = theSchemaExistsIndicatorTable; } @@ -85,11 +82,6 @@ public class SchemaInitializationProvider implements ISchemaInitializationProvid return matcher.replaceAll("$1\\)"); } - @Override - public String getDescription() { - return mySchemaDescription; - } - @Nonnull protected String getInitScript(DriverTypeEnum theDriverType) { return theDriverType.getSchemaFilename(); diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/ISchemaInitializationProvider.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/ISchemaInitializationProvider.java index edb855a5bfd..1dd3a8370cf 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/ISchemaInitializationProvider.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/tasks/api/ISchemaInitializationProvider.java @@ -28,6 +28,4 @@ public interface ISchemaInitializationProvider { List getSqlStatements(DriverTypeEnum theDriverType); String getSchemaExistsIndicatorTable(); - - String getDescription(); } diff --git a/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/InitializeSchemaTaskTest.java b/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/InitializeSchemaTaskTest.java index 9d96ea4aaa8..a55cd045f9d 100644 --- a/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/InitializeSchemaTaskTest.java +++ b/hapi-fhir-jpaserver-migrate/src/test/java/ca/uhn/fhir/jpa/migrate/taskdef/InitializeSchemaTaskTest.java @@ -40,11 +40,6 @@ public class InitializeSchemaTaskTest extends BaseTest { return "DONT_MATCH_ME"; } - @Override - public String getDescription() { - return "test"; - } - @Override public boolean equals(Object theO) { if (this == theO) return true;