Fix forced ID migration for MSSQL (#6290)
Co-authored-by: Primož Delopst <primoz.delopst@better.care>
This commit is contained in:
parent
fb93c3d601
commit
4aea94ccb6
|
@ -89,7 +89,7 @@ public class ForceIdMigrationFixTask extends BaseTask {
|
|||
" set fhir_id = coalesce( "
|
||||
+
|
||||
// case 5.
|
||||
" trim(fhir_id), "
|
||||
trimFhirId()
|
||||
+
|
||||
// case 3
|
||||
" (select f.forced_id from hfj_forced_id f where f.resource_pid = res_id), "
|
||||
|
@ -109,6 +109,22 @@ public class ForceIdMigrationFixTask extends BaseTask {
|
|||
}
|
||||
}
|
||||
|
||||
private String trimFhirId() {
|
||||
switch (getDriverType()) {
|
||||
case MSSQL_2012:
|
||||
return " LTRIM(RTRIM(fhir_id)), ";
|
||||
case H2_EMBEDDED:
|
||||
case DERBY_EMBEDDED:
|
||||
case MARIADB_10_1:
|
||||
case MYSQL_5_7:
|
||||
case POSTGRES_9_4:
|
||||
case ORACLE_12C:
|
||||
case COCKROACHDB_21_1:
|
||||
default:
|
||||
return " trim(fhir_id), ";
|
||||
}
|
||||
}
|
||||
|
||||
private String getWhereClauseByDBType() {
|
||||
switch (getDriverType()) {
|
||||
case MSSQL_2012:
|
||||
|
|
Loading…
Reference in New Issue