Skip to content

Org merge tool: management command to merge duplicate organisations #676

Description

@Joe-Heffer-Shef

Context

Most valuable for the existing backlog of duplicates, least valuable long-term unless other duplicate-prevention work also ships (otherwise new duplicates just keep accumulating).

What a merge needs to do

  • Reassign Project/Survey FKs from the losing org to the winning org
  • Reassign or de-dupe OrganisationMembership rows (a user in both orgs would collide with unique_together)
  • Decide what happens to survey responses/evidence tied to the losing org's projects — these presumably shouldn't be re-scoped silently without an audit trail, given the audit-event work that's gone into org membership changes recently (MEMBERSHIP_REMOVED event, feat: wire MEMBERSHIP_REMOVED audit event into organisation service #637)

Proposed approach

The "current workaround" today is doing this manually (delete redundant orgs). A merge management command scoped to admin/staff use (rather than a self-service UI) seems like the pragmatic first cut — lower blast radius, and it's the kind of one-off/staff-tooling operation that fits the existing SAR export console pattern rather than needing new end-user UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions