Skip to content

Commit

Permalink
Fix default data source lost when create migration job (apache#32735)
Browse files Browse the repository at this point in the history
  • Loading branch information
RaigorJiang authored Aug 30, 2024
1 parent 677749f commit 6f0d325
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ private void removeAuthorityRuleConfiguration(final YamlRootConfiguration yamlRo
}

private void updateSingleRuleConfiguration(final YamlRootConfiguration yamlRootConfig) {
Optional<YamlSingleRuleConfiguration> originalSingleRuleConfig =
yamlRootConfig.getRules().stream().filter(YamlSingleRuleConfiguration.class::isInstance).map(YamlSingleRuleConfiguration.class::cast).findFirst();
yamlRootConfig.getRules().removeIf(YamlSingleRuleConfiguration.class::isInstance);
YamlSingleRuleConfiguration singleRuleConfig = new YamlSingleRuleConfiguration();
singleRuleConfig.setTables(Collections.singletonList(SingleTableConstants.ALL_TABLES));
originalSingleRuleConfig.ifPresent(optional -> singleRuleConfig.setDefaultDataSource(optional.getDefaultDataSource()));
yamlRootConfig.getRules().add(singleRuleConfig);
}

Expand Down

0 comments on commit 6f0d325

Please sign in to comment.