Cascade delete notifications for user

This commit is contained in:
rockstardev
2020-06-13 18:45:44 -05:00
parent 455ac8786a
commit 09a72f2cfb
3 changed files with 44 additions and 2 deletions

View File

@@ -26,7 +26,7 @@ namespace BTCPayServer.Data
builder.Entity<NotificationData>()
.HasOne(o => o.ApplicationUser)
.WithMany(n => n.Notifications)
.HasForeignKey(k => k.ApplicationUserId);
.HasForeignKey(k => k.ApplicationUserId).OnDelete(DeleteBehavior.Cascade);
}
}
}