mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-18 21:32:27 +01:00
3cf1aa00fa
* Payments should use composite key * Invert PK for InvoiceAddress
27 lines
837 B
C#
27 lines
837 B
C#
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
|
|
|
namespace BTCPayServer.Data
|
|
{
|
|
public class AddressInvoiceData
|
|
{
|
|
public string Address { get; set; }
|
|
public InvoiceData InvoiceData { get; set; }
|
|
public string InvoiceDataId { get; set; }
|
|
public string PaymentMethodId { get; set; }
|
|
|
|
|
|
internal static void OnModelCreating(ModelBuilder builder)
|
|
{
|
|
builder.Entity<AddressInvoiceData>()
|
|
.HasOne(o => o.InvoiceData)
|
|
.WithMany(i => i.AddressInvoices).OnDelete(DeleteBehavior.Cascade);
|
|
builder.Entity<AddressInvoiceData>()
|
|
#pragma warning disable CS0618
|
|
.HasKey(o => new { o.Address, o.PaymentMethodId });
|
|
#pragma warning restore CS0618
|
|
}
|
|
}
|
|
}
|