fix: null user/paste fk in reports on delete

This commit is contained in:
2026-01-23 10:56:08 -05:00
parent ae91108484
commit f8a1490582
4 changed files with 422 additions and 6 deletions
@@ -131,9 +131,7 @@ namespace SharpbinV3.Server.Migrations
.HasColumnType("INTEGER");
b.Property<byte[]>("RowVersion")
.IsConcurrencyToken()
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("BLOB");
b.Property<string>("TokenHash")
@@ -302,11 +300,13 @@ namespace SharpbinV3.Server.Migrations
{
b.HasOne("SharpbinV3.Server.Data.Entities.Paste", "Paste")
.WithMany("Reports")
.HasForeignKey("PastePID");
.HasForeignKey("PastePID")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("SharpbinV3.Server.Data.Entities.User", "User")
.WithMany("Reports")
.HasForeignKey("UserUUID");
.HasForeignKey("UserUUID")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("Paste");