Skip to content

Commit

Permalink
Fix update to update foreach Group (#14945)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeegaan committed Oct 11, 2023
1 parent 332ef6f commit 443f036
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -46,9 +46,13 @@ private void MigrateSqlServer()
AddColumnIfNotExists<UserGroupDto>(columns, NewColumnName);

// We want specific keys for the default user groups, so we need to fetch the user groups again to set their keys.
IEnumerable<Guid> updatedUserGroups = Database.Fetch<UserGroupDto>()
.Select(x => x.Key = ResolveAliasToGuid(x.Alias));
Database.Update(updatedUserGroups);
List<UserGroupDto>? userGroups = Database.Fetch<UserGroupDto>();

foreach (UserGroupDto userGroup in userGroups)
{
userGroup.Key = ResolveAliasToGuid(userGroup.Alias);
Database.Update(userGroup);
}

scope.Complete();
}
Expand Down

0 comments on commit 443f036

Please sign in to comment.