Github user michaelarusso commented on a diff in the pull request:
https://github.com/apache/usergrid/pull/451#discussion_r48162531
--- Diff:
stack/tools/src/main/java/org/apache/usergrid/tools/DuplicateOrgRepair.java ---
@@ -529,10 +529,22 @@ public void call(Subscriber<? super OrgUser>
subscriber) {
@Override
public void removeOrg(Org keeper, Org duplicate) throws Exception {
- // we don't have a remove org API so rename org so that it is
no longer a duplicate
+
+ // rename org so that it is no longer a duplicate
OrganizationInfo orgInfo =
managementService.getOrganizationByUuid( duplicate.getId() );
orgInfo.setName( "dup_" + keeper.getId() + "_" +
RandomStringUtils.randomAlphanumeric(10) );
managementService.updateOrganization( orgInfo );
+
+ // fix the org name index
+ OrganizationInfo orgInfoKeeper =
managementService.getOrganizationByUuid( duplicate.getId() );
+ try {
+ managementService.updateOrganizationUniqueIndex( orgInfo,
duplicate.getId() );
--- End diff --
this should take in the keeper org's OrganizationInfo, and the duplicate's
ID. Looks like we're passing in the duplicates OrganizationInfo as well as the
ID.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---