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 java.sql.*;
|
||||
import java.util.HashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
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 {
|
||||
|
||||
if (!getTableNames(theConnectionProperties).contains(theTableName)) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
DataSource dataSource = Objects.requireNonNull(theConnectionProperties.getDataSource());
|
||||
try (Connection connection = dataSource.getConnection()) {
|
||||
return theConnectionProperties.getTxTemplate().execute(t -> {
|
||||
|
|
|
@ -86,10 +86,6 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
|
|||
version.onTable("TRM_VALUESET")
|
||||
.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")
|
||||
.renameColumn("CODE", "CODEVAL", false, true);
|
||||
|
||||
|
@ -127,6 +123,9 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
|
|||
.unique(false)
|
||||
.withColumns("SYSTEM_URL", "CODEVAL");
|
||||
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
|
||||
version.startSectionWithMessage("Processing table: TRM_VALUESET_C_DESIGNATION");
|
||||
|
|
Loading…
Reference in New Issue