mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 00:22:50 -05:00
Organization integration database / repository logic (#5602)
* Organization integration creation, update, and deletion database logic * Additional procs and entity tweaks * Use check * Couple newlines * Forgot to script the two org procs
This commit is contained in:
@ -9,7 +9,7 @@ public class OrganizationIntegrationConfigurationEntityTypeConfiguration : IEnti
|
||||
public void Configure(EntityTypeBuilder<OrganizationIntegrationConfiguration> builder)
|
||||
{
|
||||
builder
|
||||
.Property(p => p.Id)
|
||||
.Property(oic => oic.Id)
|
||||
.ValueGeneratedNever();
|
||||
|
||||
builder.ToTable(nameof(OrganizationIntegrationConfiguration));
|
||||
|
@ -9,15 +9,15 @@ public class OrganizationIntegrationEntityTypeConfiguration : IEntityTypeConfigu
|
||||
public void Configure(EntityTypeBuilder<OrganizationIntegration> builder)
|
||||
{
|
||||
builder
|
||||
.Property(p => p.Id)
|
||||
.Property(oi => oi.Id)
|
||||
.ValueGeneratedNever();
|
||||
|
||||
builder
|
||||
.HasIndex(p => p.OrganizationId)
|
||||
.HasIndex(oi => oi.OrganizationId)
|
||||
.IsClustered(false);
|
||||
|
||||
builder
|
||||
.HasIndex(p => new { p.OrganizationId, p.Type })
|
||||
.HasIndex(oi => new { oi.OrganizationId, oi.Type })
|
||||
.IsUnique()
|
||||
.IsClustered(false);
|
||||
|
||||
|
@ -199,6 +199,8 @@ public class OrganizationRepository : Repository<Core.AdminConsole.Entities.Orga
|
||||
.ExecuteDeleteAsync();
|
||||
await dbContext.ProviderOrganizations.Where(po => po.OrganizationId == organization.Id)
|
||||
.ExecuteDeleteAsync();
|
||||
await dbContext.OrganizationIntegrations.Where(oi => oi.OrganizationId == organization.Id)
|
||||
.ExecuteDeleteAsync();
|
||||
|
||||
await dbContext.GroupServiceAccountAccessPolicy.Where(ap => ap.GrantedServiceAccount.OrganizationId == organization.Id)
|
||||
.ExecuteDeleteAsync();
|
||||
|
Reference in New Issue
Block a user