it works now
This commit is contained in:
parent
190e9bed58
commit
5e8eec8bf6
|
@ -34,6 +34,7 @@ import java.util.Set;
|
|||
|
||||
public class InitializeSchemaTask extends BaseTask<InitializeSchemaTask> {
|
||||
private static final Logger ourLog = LoggerFactory.getLogger(InitializeSchemaTask.class);
|
||||
|
||||
private final ISchemaInitializationProvider mySchemaInitializationProvider;
|
||||
|
||||
public InitializeSchemaTask(String theProductVersion, String theSchemaVersion, ISchemaInitializationProvider theSchemaInitializationProvider) {
|
||||
|
@ -77,4 +78,8 @@ public class InitializeSchemaTask extends BaseTask<InitializeSchemaTask> {
|
|||
protected void generateHashCode(HashCodeBuilder theBuilder) {
|
||||
theBuilder.append(mySchemaInitializationProvider);
|
||||
}
|
||||
|
||||
public ISchemaInitializationProvider getSchemaInitializationProvider() {
|
||||
return mySchemaInitializationProvider;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -893,7 +893,7 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
|
|||
|
||||
}
|
||||
|
||||
private void init330() { // 20180114 - 20180329
|
||||
protected void init330() { // 20180114 - 20180329
|
||||
Builder version = forVersion(VersionEnum.V3_3_0);
|
||||
|
||||
version.initializeSchema("20180115.0", new SchemaInitializationProvider("/ca/uhn/hapi/fhir/jpa/docs/database", "HFJ_RESOURCE"));
|
||||
|
|
|
@ -37,7 +37,7 @@ import static org.apache.commons.lang3.StringUtils.isBlank;
|
|||
|
||||
public class SchemaInitializationProvider implements ISchemaInitializationProvider {
|
||||
|
||||
private final String mySchemaFileClassPath;
|
||||
private String mySchemaFileClassPath;
|
||||
private final String mySchemaExistsIndicatorTable;
|
||||
|
||||
/**
|
||||
|
@ -110,5 +110,10 @@ public class SchemaInitializationProvider implements ISchemaInitializationProvid
|
|||
public String getSchemaExistsIndicatorTable() {
|
||||
return mySchemaExistsIndicatorTable;
|
||||
}
|
||||
|
||||
public SchemaInitializationProvider setSchemaFileClassPath(String theSchemaFileClassPath) {
|
||||
mySchemaFileClassPath = theSchemaFileClassPath;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -81,6 +81,13 @@ public class BaseMigrationTasks<T extends Enum> {
|
|||
return retval;
|
||||
}
|
||||
|
||||
protected BaseTask getTaskWithVersion(String theFlywayVersion) {
|
||||
return myTasks.values().stream()
|
||||
.filter(task -> theFlywayVersion.equals(task.getFlywayVersion()))
|
||||
.findFirst()
|
||||
.get();
|
||||
}
|
||||
|
||||
void validate(Collection<BaseTask> theTasks) {
|
||||
for (BaseTask task: theTasks) {
|
||||
task.validateVersion();
|
||||
|
|
Loading…
Reference in New Issue