Migrate profile IDs in history database when merging profiles
This commit is contained in:
@@ -77,10 +77,12 @@ func MergeProfiles(name string, primary *Profile, secondaries ...*Profile) (newP
|
||||
if err := primary.delete(); err != nil {
|
||||
return nil, fmt.Errorf("failed to delete primary profile %s: %w", primary.ScopedID(), err)
|
||||
}
|
||||
module.TriggerEvent(MigratedEvent, []string{primary.ScopedID(), newProfile.ScopedID()})
|
||||
for _, sp := range secondaries {
|
||||
if err := sp.delete(); err != nil {
|
||||
return nil, fmt.Errorf("failed to delete secondary profile %s: %w", sp.ScopedID(), err)
|
||||
}
|
||||
module.TriggerEvent(MigratedEvent, []string{sp.ScopedID(), newProfile.ScopedID()})
|
||||
}
|
||||
|
||||
return newProfile, nil
|
||||
|
||||
Reference in New Issue
Block a user