1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 23:52:50 -05:00

Null org, org user ids, and friendly name to indicate invalid, unused sponsorship state (#1738)

* Null org, org user ids, and friendly name to indicate invalid, unused sponsorship state

* Match EF queries to MSSQL sprocs
This commit is contained in:
Matt Gibson
2021-12-01 14:34:56 -06:00
committed by GitHub
parent ad18adf471
commit 757927e02a
3 changed files with 83 additions and 0 deletions

View File

@ -113,6 +113,7 @@ namespace Bit.Core.Repositories.EntityFramework
{
sponsorship.SponsoredOrganizationId = UpdatedOrgId(sponsorship.SponsoredOrganizationId);
sponsorship.SponsoringOrganizationId = UpdatedOrgId(sponsorship.SponsoringOrganizationId);
sponsorship.FriendlyName = null;
}
dbContext.Remove(orgEntity);

View File

@ -80,6 +80,7 @@ namespace Bit.Core.Repositories.EntityFramework
foreach (var sponsorship in sponsorships)
{
sponsorship.SponsoringOrganizationUserId = null;
sponsorship.FriendlyName = null;
}
dbContext.Remove(orgUser);
@ -99,6 +100,7 @@ namespace Bit.Core.Repositories.EntityFramework
foreach (var sponsorship in sponsorships)
{
sponsorship.SponsoringOrganizationUserId = null;
sponsorship.FriendlyName = null;
}
dbContext.RemoveRange(entities);