btcpayserver/BTCPayServer.Data/Data/WebhookData.cs

30 lines
865 B
C#
Raw Normal View History

using System;
2020-11-06 20:42:26 +09:00
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
2020-11-06 20:42:26 +09:00
namespace BTCPayServer.Data
{
public class WebhookData : IHasBlobUntyped
2020-11-06 20:42:26 +09:00
{
[Key]
[MaxLength(25)]
public string Id { get; set; }
[Obsolete("Use Blob2 instead")]
2020-11-06 20:42:26 +09:00
public byte[] Blob { get; set; }
public string Blob2 { get; set; }
2020-11-06 20:42:26 +09:00
public List<WebhookDeliveryData> Deliveries { get; set; }
internal static void OnModelCreating(ModelBuilder builder, DatabaseFacade databaseFacade)
{
if (databaseFacade.IsNpgsql())
{
builder.Entity<WebhookData>()
.Property(o => o.Blob2)
.HasColumnType("JSONB");
}
}
2020-11-06 20:42:26 +09:00
}
}