Skip to content

Commit

Permalink
generic repo cleanup: removed schemaVariant config option (MySQL/Maria)
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Jun 8, 2022
1 parent 25a5f8f commit c6876a8
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2021 Evolveum and contributors
* Copyright (C) 2010-2022 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
Expand Down Expand Up @@ -114,7 +114,6 @@ private void updateConfigurationFromProperties(Configuration configuration, Prop
updateConfigurationStringProperty(configuration, properties, PROPERTY_INCOMPATIBLE_SCHEMA_ACTION);
updateConfigurationStringProperty(configuration, properties, PROPERTY_SCHEMA_VERSION_IF_MISSING);
updateConfigurationStringProperty(configuration, properties, PROPERTY_SCHEMA_VERSION_OVERRIDE);
updateConfigurationStringProperty(configuration, properties, PROPERTY_SCHEMA_VARIANT);

updateConfigurationStringProperty(configuration, properties, PROPERTY_TRANSACTION_ISOLATION);
updateConfigurationBooleanProperty(configuration, properties, PROPERTY_LOCK_FOR_UPDATE_VIA_HIBERNATE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1303,23 +1303,6 @@ public void test935WorkItemsOwnedByAccessCertificationCase() throws SchemaExcept
assertThat(assignments).hasSize(3);
}

/* TODO remove when test exists
SearchResultList<AccessCertificationWorkItemType> result = searchContainerTest(
"by parent using exists", AccessCertificationWorkItemType.class,
f -> f.ownedBy(AccessCertificationCaseType.class)
.block()
.id(1)
.and()
.ownedBy(AccessCertificationCampaignType.class)
.id(accCertCampaign1Oid)
.endBlock());
// The resulting query only uses IDs that are available directly in the container table,
// but our query uses exists which can be used for anything... we don't optimize this.
assertThat(result)
.extracting(a -> a.getStageNumber())
.containsExactlyInAnyOrder(11, 12);
*/

@Test
public void test939OwnedByComplainsAboutInvalidTypesAndPathsCombinations() {
expect("query fails when ownedBy types (owned and owning) do not make sense");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ public static IncompatibleSchemaAction fromValue(String text) {
public static final String PROPERTY_INCOMPATIBLE_SCHEMA_ACTION = "incompatibleSchemaAction";
public static final String PROPERTY_SCHEMA_VERSION_IF_MISSING = "schemaVersionIfMissing";
public static final String PROPERTY_SCHEMA_VERSION_OVERRIDE = "schemaVersionOverride";
public static final String PROPERTY_SCHEMA_VARIANT = "schemaVariant";

public static final String PROPERTY_ENABLE_NO_FETCH_EXTENSION_VALUES_INSERTION = "enableNoFetchExtensionValuesInsertion";
public static final String PROPERTY_ENABLE_NO_FETCH_EXTENSION_VALUES_DELETION = "enableNoFetchExtensionValuesDeletion";
Expand Down Expand Up @@ -288,7 +287,6 @@ public static IncompatibleSchemaAction fromValue(String text) {
@NotNull private final IncompatibleSchemaAction incompatibleSchemaAction;
private final String schemaVersionIfMissing;
private final String schemaVersionOverride;
private final String schemaVariant;

private boolean enableNoFetchExtensionValuesInsertion;
private boolean enableNoFetchExtensionValuesDeletion;
Expand Down Expand Up @@ -422,7 +420,6 @@ public SqlRepositoryConfiguration(Configuration configuration) {

schemaVersionIfMissing = configuration.getString(PROPERTY_SCHEMA_VERSION_IF_MISSING);
schemaVersionOverride = configuration.getString(PROPERTY_SCHEMA_VERSION_OVERRIDE);
schemaVariant = configuration.getString(PROPERTY_SCHEMA_VARIANT);

initializationFailTimeout = configuration.getLong(PROPERTY_INITIALIZATION_FAIL_TIMEOUT, 1L);

Expand Down Expand Up @@ -883,11 +880,6 @@ public String getSchemaVersionOverride() {
return schemaVersionOverride;
}

// TODO: Previously used for MySQL/MariaDB, do we still need it?
public String getSchemaVariant() {
return schemaVariant;
}

@Override
public long getInitializationFailTimeout() {
return initializationFailTimeout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,17 +279,12 @@ private MissingSchemaAction getMissingSchemaAction() {

private String determineUpgradeScriptFileName(@NotNull String from, @NotNull String to) {
return getDatabaseType().name().toLowerCase()
+ "-upgrade-" + from + "-" + to + getVariantSuffix() + ".sql";
+ "-upgrade-" + from + "-" + to + ".sql";
}

private String determineCreateScriptFileName() {
return getDatabaseType().name().toLowerCase()
+ "-" + REQUIRED_DATABASE_SCHEMA_VERSION + "-all" + getVariantSuffix() + ".sql";
}

private String getVariantSuffix() {
String variant = repositoryConfiguration.getSchemaVariant();
return variant != null ? "-" + variant : "";
+ "-" + REQUIRED_DATABASE_SCHEMA_VERSION + "-all" + ".sql";
}

@NotNull
Expand Down

0 comments on commit c6876a8

Please sign in to comment.