Merge pull request #3013 from hapifhir/jr-20210921-mssql-data-migration
Fix MS SQLServer database migration
This commit is contained in:
commit
d5c6461e2c
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
type: fix
|
||||
issue: 3012
|
||||
title: "Fixes migration of VARBINARY columns on MS SQLServer."
|
|
@ -220,6 +220,14 @@ public class TestUtil {
|
|||
|
||||
}
|
||||
|
||||
for (Class<?> innerClass : theClazz.getDeclaredClasses()) {
|
||||
Embeddable embeddable = innerClass.getAnnotation(Embeddable.class);
|
||||
if (embeddable != null) {
|
||||
scanClassOrSuperclass(theNames, innerClass, false, columnNameToLength);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (theClazz.getSuperclass().equals(Object.class)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -185,6 +185,13 @@ public class JdbcUtils {
|
|||
return new ColumnType(ColumnTypeEnum.DATE_TIMESTAMP, length);
|
||||
case Types.BLOB:
|
||||
return new ColumnType(ColumnTypeEnum.BLOB, length);
|
||||
case Types.VARBINARY:
|
||||
if (DriverTypeEnum.MSSQL_2012.equals(theConnectionProperties.getDriverType())) {
|
||||
// MS SQLServer seems to be mapping BLOB to VARBINARY under the covers, so we need to reverse that mapping
|
||||
return new ColumnType(ColumnTypeEnum.BLOB, length);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Don't know how to handle datatype " + dataType + " for column " + theColumnName + " on table " + theTableName);
|
||||
}
|
||||
case Types.CLOB:
|
||||
return new ColumnType(ColumnTypeEnum.CLOB, length);
|
||||
case Types.DOUBLE:
|
||||
|
|
|
@ -526,6 +526,11 @@ public class Builder {
|
|||
super.addTask(theTask);
|
||||
}
|
||||
}
|
||||
|
||||
public BuilderAddTableByColumns failureAllowed() {
|
||||
myTask.setFailureAllowed(true);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue