mirror of
https://github.com/bitwarden/server
synced 2026-01-04 01:23:25 +00:00
[PM-20064] Add cascade deletion for cipher with tasks (#5690)
* add cascade deletion for cipher tasks * add migrations for cascade delete on ciphers and security tasks * remove trailing comma * add SQL migration for PasswordHealthReportApplication - Allow cascade delete when an organization is deleted
This commit is contained in:
@@ -24,6 +24,18 @@ public class SecurityTaskEntityTypeConfiguration : IEntityTypeConfiguration<Secu
|
||||
.HasIndex(s => s.CipherId)
|
||||
.IsClustered(false);
|
||||
|
||||
builder
|
||||
.HasOne(p => p.Organization)
|
||||
.WithMany()
|
||||
.HasForeignKey(p => p.OrganizationId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
builder
|
||||
.HasOne(p => p.Cipher)
|
||||
.WithMany()
|
||||
.HasForeignKey(p => p.CipherId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
builder
|
||||
.ToTable(nameof(SecurityTask));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user