One migrator tweak
This commit is contained in:
parent
f53746cd63
commit
6ff8484914
|
@ -41,10 +41,7 @@ import org.springframework.jdbc.core.ColumnMapRowMapper;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
import java.util.HashSet;
|
import java.util.*;
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import static org.thymeleaf.util.StringUtils.toUpperCase;
|
import static org.thymeleaf.util.StringUtils.toUpperCase;
|
||||||
|
|
||||||
|
@ -56,6 +53,10 @@ public class JdbcUtils {
|
||||||
*/
|
*/
|
||||||
public static Set<String> getIndexNames(DriverTypeEnum.ConnectionProperties theConnectionProperties, String theTableName) throws SQLException {
|
public static Set<String> getIndexNames(DriverTypeEnum.ConnectionProperties theConnectionProperties, String theTableName) throws SQLException {
|
||||||
|
|
||||||
|
if (!getTableNames(theConnectionProperties).contains(theTableName)) {
|
||||||
|
return Collections.emptySet();
|
||||||
|
}
|
||||||
|
|
||||||
DataSource dataSource = Objects.requireNonNull(theConnectionProperties.getDataSource());
|
DataSource dataSource = Objects.requireNonNull(theConnectionProperties.getDataSource());
|
||||||
try (Connection connection = dataSource.getConnection()) {
|
try (Connection connection = dataSource.getConnection()) {
|
||||||
return theConnectionProperties.getTxTemplate().execute(t -> {
|
return theConnectionProperties.getTxTemplate().execute(t -> {
|
||||||
|
|
|
@ -86,10 +86,6 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
|
||||||
version.onTable("TRM_VALUESET")
|
version.onTable("TRM_VALUESET")
|
||||||
.renameColumn("NAME", "VSNAME", true, true);
|
.renameColumn("NAME", "VSNAME", true, true);
|
||||||
|
|
||||||
version.onTable("TRM_VALUESET_CONCEPT")
|
|
||||||
.renameColumn("CODE", "CODEVAL", true, true)
|
|
||||||
.renameColumn("SYSTEM", "SYSTEM_URL", true, true);
|
|
||||||
|
|
||||||
version.onTable("TRM_CONCEPT")
|
version.onTable("TRM_CONCEPT")
|
||||||
.renameColumn("CODE", "CODEVAL", false, true);
|
.renameColumn("CODE", "CODEVAL", false, true);
|
||||||
|
|
||||||
|
@ -127,6 +123,9 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
|
||||||
.unique(false)
|
.unique(false)
|
||||||
.withColumns("SYSTEM_URL", "CODEVAL");
|
.withColumns("SYSTEM_URL", "CODEVAL");
|
||||||
termValueSetConceptTable.addColumn("DISPLAY").nullable().type(BaseTableColumnTypeTask.ColumnTypeEnum.STRING, TermConcept.MAX_DESC_LENGTH);
|
termValueSetConceptTable.addColumn("DISPLAY").nullable().type(BaseTableColumnTypeTask.ColumnTypeEnum.STRING, TermConcept.MAX_DESC_LENGTH);
|
||||||
|
version.onTable("TRM_VALUESET_CONCEPT")
|
||||||
|
.renameColumn("CODE", "CODEVAL", true, true)
|
||||||
|
.renameColumn("SYSTEM", "SYSTEM_URL", true, true);
|
||||||
|
|
||||||
// TermValueSetConceptDesignation
|
// TermValueSetConceptDesignation
|
||||||
version.startSectionWithMessage("Processing table: TRM_VALUESET_C_DESIGNATION");
|
version.startSectionWithMessage("Processing table: TRM_VALUESET_C_DESIGNATION");
|
||||||
|
|
Loading…
Reference in New Issue