Skip to content

Commit

Permalink
Merge branch 'rel_8_0' into 6700-fix-partition-id-for-mdm
Browse files Browse the repository at this point in the history
  • Loading branch information
leif stawnyczy committed Feb 12, 2025
2 parents 6bb2b78 + d503a24 commit 2edfbed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public final class HapiSystemProperties {
static final long DEFAULT_VALIDATION_RESOURCE_CACHE_TIMEOUT_MILLIS = TimeUnit.MINUTES.toMillis(10);
static final String PREVENT_INVALIDATING_CONDITIONAL_MATCH_CRITERIA =
"hapi.storage.prevent_invalidating_conditional_match_criteria";
static final String DISABLE_DATABASE_PARTITION_MODE_SCHEMA_CHECK =
"hapi.storage.disable_database_partition_mode_schema_check";

private HapiSystemProperties() {}

Expand Down Expand Up @@ -164,4 +166,9 @@ public static boolean isPreventInvalidatingConditionalMatchCriteria() {
return Boolean.parseBoolean(System.getProperty(
HapiSystemProperties.PREVENT_INVALIDATING_CONDITIONAL_MATCH_CRITERIA, Boolean.FALSE.toString()));
}

public static boolean isDisableDatabasePartitionModeSchemaCheck() {
return Boolean.parseBoolean(System.getProperty(
HapiSystemProperties.DISABLE_DATABASE_PARTITION_MODE_SCHEMA_CHECK, Boolean.FALSE.toString()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import ca.uhn.fhir.jpa.migrate.JdbcUtils;
import ca.uhn.fhir.jpa.model.config.PartitionSettings;
import ca.uhn.fhir.jpa.model.dialect.IHapiFhirDialect;
import ca.uhn.fhir.system.HapiSystemProperties;
import org.apache.commons.collections4.SetUtils;
import org.hibernate.dialect.Dialect;
import org.slf4j.Logger;
Expand Down Expand Up @@ -87,6 +88,11 @@ public void verifyPartitionedIdMode() throws SQLException {

public static void verifySchemaIsAppropriateForDatabasePartitionMode(
DriverTypeEnum.ConnectionProperties cp, boolean expectDatabasePartitionMode) throws SQLException {

if (HapiSystemProperties.isDisableDatabasePartitionModeSchemaCheck()) {
return;
}

Set<String> pkColumns = JdbcUtils.getPrimaryKeyColumns(cp, "HFJ_RESOURCE");
if (pkColumns.isEmpty()) {
return;
Expand Down

0 comments on commit 2edfbed

Please sign in to comment.