mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-24 01:14:20 +01:00
Isolate OnModelCreating in Data classes (#1702)
This commit is contained in:
@@ -83,6 +83,10 @@ namespace BTCPayServer.Data
|
||||
public RefundData CurrentRefund { get; set; }
|
||||
internal static void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
builder.Entity<InvoiceData>()
|
||||
.HasOne(o => o.StoreData)
|
||||
.WithMany(a => a.Invoices).OnDelete(DeleteBehavior.Cascade);
|
||||
builder.Entity<InvoiceData>().HasIndex(o => o.StoreDataId);
|
||||
builder.Entity<InvoiceData>()
|
||||
.HasOne(o => o.CurrentRefund);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user