mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 09:54:30 +01:00
32 lines
829 B
C#
32 lines
829 B
C#
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace BTCPayServer.Data
|
|
{
|
|
public class PairedSINData
|
|
{
|
|
public string Id { get; set; }
|
|
|
|
public string StoreDataId { get; set; }
|
|
|
|
public StoreData StoreData { get; set; }
|
|
|
|
public string Label { get; set; }
|
|
public DateTimeOffset PairingTime { get; set; }
|
|
public string SIN { get; set; }
|
|
|
|
|
|
internal static void OnModelCreating(ModelBuilder builder)
|
|
{
|
|
builder.Entity<PairedSINData>()
|
|
.HasOne(o => o.StoreData)
|
|
.WithMany(i => i.PairedSINs).OnDelete(DeleteBehavior.Cascade);
|
|
builder.Entity<PairedSINData>(b =>
|
|
{
|
|
b.HasIndex(o => o.SIN);
|
|
b.HasIndex(o => o.StoreDataId);
|
|
});
|
|
}
|
|
}
|
|
}
|