Skip to content

Commit

Permalink
- use Restrict for Deletion props
Browse files Browse the repository at this point in the history
  • Loading branch information
ArdenHide committed Dec 5, 2024
1 parent bd41722 commit 110ea67
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/DispenserProvider.DataBase/DispenserContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.HasOne(e => e.DeletionLog)
.WithMany(e => e.DeletionDispensers)
.HasForeignKey(e => e.DeletionLogSignature)
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Restrict);
});

modelBuilder.Entity<TransactionDetailDTO>(entity =>
Expand Down Expand Up @@ -108,7 +108,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.HasMany(e => e.DeletionDispensers)
.WithOne(e => e.DeletionLog)
.HasForeignKey(e => e.DeletionLogSignature)
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Restrict);
});
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
column: "DeletionLogSignature",
principalTable: "Logs",
principalColumn: "Signature",
onDelete: ReferentialAction.Cascade);
onDelete: ReferentialAction.Restrict);
}

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.HasOne("DispenserProvider.DataBase.Models.LogDTO", "DeletionLog")
.WithMany("DeletionDispensers")
.HasForeignKey("DeletionLogSignature")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Restrict);

b.HasOne("DispenserProvider.DataBase.Models.TransactionDetailDTO", "RefundDetail")
.WithOne()
Expand Down

0 comments on commit 110ea67

Please sign in to comment.