btcpayserver/BTCPayServer.Data/Migrations/ApplicationDbContextModelSnapshot.cs
2024-12-13 10:12:39 +01:00

1703 lines
58 KiB
C#

// <auto-generated />
using System;
using System.Collections.Generic;
using BTCPayServer.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace BTCPayServer.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.7")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("BTCPayServer.App.BackupStorage.AppStorageItemData", b =>
{
b.Property<string>("Key")
.HasColumnType("text");
b.Property<long>("Version")
.HasColumnType("bigint");
b.Property<string>("UserId")
.HasColumnType("text");
b.Property<byte[]>("Value")
.HasColumnType("bytea");
b.HasKey("Key", "Version", "UserId");
b.HasIndex("UserId");
b.HasIndex("Key", "UserId")
.IsUnique();
b.ToTable("AppStorageItems", t =>
{
t.HasTrigger("LC_TRIGGER_BEFORE_INSERT_APPSTORAGEITEMDATA");
});
b.HasAnnotation("LC_TRIGGER_BEFORE_INSERT_APPSTORAGEITEMDATA", "CREATE FUNCTION \"LC_TRIGGER_BEFORE_INSERT_APPSTORAGEITEMDATA\"() RETURNS trigger as $LC_TRIGGER_BEFORE_INSERT_APPSTORAGEITEMDATA$\r\nBEGIN\r\n DELETE FROM \"AppStorageItems\"\r\n WHERE NEW.\"UserId\" = \"AppStorageItems\".\"UserId\" AND NEW.\"Key\" = \"AppStorageItems\".\"Key\" AND NEW.\"Version\" > \"AppStorageItems\".\"Version\";\r\nRETURN NEW;\r\nEND;\r\n$LC_TRIGGER_BEFORE_INSERT_APPSTORAGEITEMDATA$ LANGUAGE plpgsql;\r\nCREATE TRIGGER LC_TRIGGER_BEFORE_INSERT_APPSTORAGEITEMDATA BEFORE INSERT\r\nON \"AppStorageItems\"\r\nFOR EACH ROW EXECUTE PROCEDURE \"LC_TRIGGER_BEFORE_INSERT_APPSTORAGEITEMDATA\"();");
});
modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b =>
{
b.Property<string>("Id")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<byte[]>("Blob")
.HasColumnType("bytea");
b.Property<string>("Blob2")
.HasColumnType("JSONB");
b.Property<string>("Label")
.HasColumnType("text");
b.Property<string>("StoreId")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<int>("Type")
.HasColumnType("integer");
b.Property<string>("UserId")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.HasIndex("StoreId");
b.HasIndex("UserId");
b.ToTable("ApiKeys");
});
modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b =>
{
b.Property<string>("Address")
.HasColumnType("text");
b.Property<string>("PaymentMethodId")
.HasColumnType("text");
b.Property<string>("InvoiceDataId")
.HasColumnType("text");
b.HasKey("Address", "PaymentMethodId");
b.HasIndex("InvoiceDataId");
b.ToTable("AddressInvoices");
});
modelBuilder.Entity("BTCPayServer.Data.AppData", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("AppType")
.HasColumnType("text");
b.Property<bool>("Archived")
.HasColumnType("boolean");
b.Property<DateTimeOffset>("Created")
.HasColumnType("timestamp with time zone");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("Settings")
.HasColumnType("JSONB");
b.Property<string>("StoreDataId")
.HasColumnType("text");
b.Property<bool>("TagAllInvoices")
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("StoreDataId");
b.ToTable("Apps");
});
modelBuilder.Entity("BTCPayServer.Data.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<int>("AccessFailedCount")
.HasColumnType("integer");
b.Property<bool>("Approved")
.HasColumnType("boolean");
b.Property<byte[]>("Blob")
.HasColumnType("bytea");
b.Property<string>("Blob2")
.HasColumnType("JSONB");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<DateTimeOffset?>("Created")
.HasColumnType("timestamp with time zone");
b.Property<string>("DisabledNotifications")
.HasColumnType("text");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("boolean");
b.Property<bool>("LockoutEnabled")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("timestamp with time zone");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("PasswordHash")
.HasColumnType("text");
b.Property<string>("PhoneNumber")
.HasColumnType("text");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("boolean");
b.Property<bool>("RequiresApproval")
.HasColumnType("boolean");
b.Property<bool>("RequiresEmailConfirmation")
.HasColumnType("boolean");
b.Property<string>("SecurityStamp")
.HasColumnType("text");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("boolean");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("BTCPayServer.Data.Fido2Credential", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("text");
b.Property<string>("ApplicationUserId")
.HasColumnType("text");
b.Property<byte[]>("Blob")
.HasColumnType("bytea");
b.Property<string>("Blob2")
.HasColumnType("JSONB");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<int>("Type")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("ApplicationUserId");
b.ToTable("Fido2Credentials");
});
modelBuilder.Entity("BTCPayServer.Data.FormData", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("text");
b.Property<string>("Config")
.HasColumnType("JSONB");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<bool>("Public")
.HasColumnType("boolean");
b.Property<string>("StoreId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("StoreId");
b.ToTable("Forms");
});
modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<decimal?>("Amount")
.HasColumnType("NUMERIC");
b.Property<bool>("Archived")
.HasColumnType("boolean");
b.Property<byte[]>("Blob")
.HasColumnType("bytea");
b.Property<string>("Blob2")
.HasColumnType("JSONB");
b.Property<DateTimeOffset>("Created")
.HasColumnType("timestamp with time zone");
b.Property<string>("Currency")
.HasColumnType("text");
b.Property<string>("ExceptionStatus")
.HasColumnType("text");
b.Property<string>("Status")
.HasColumnType("text");
b.Property<string>("StoreDataId")
.HasColumnType("text");
b.Property<uint>("XMin")
.IsConcurrencyToken()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("xid")
.HasColumnName("xmin");
b.HasKey("Id");
b.HasIndex("Created");
b.HasIndex("StoreDataId");
b.ToTable("Invoices");
});
modelBuilder.Entity("BTCPayServer.Data.InvoiceSearchData", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("MySql:ValueGeneratedOnAdd", true)
.HasAnnotation("Sqlite:Autoincrement", true);
NpgsqlPropertyBuilderExtensions.UseSerialColumn(b.Property<int>("Id"));
b.Property<string>("InvoiceDataId")
.HasColumnType("text");
b.Property<string>("Value")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("InvoiceDataId");
b.HasIndex("Value");
b.ToTable("InvoiceSearches");
});
modelBuilder.Entity("BTCPayServer.Data.InvoiceWebhookDeliveryData", b =>
{
b.Property<string>("InvoiceId")
.HasColumnType("text");
b.Property<string>("DeliveryId")
.HasColumnType("character varying(25)");
b.HasKey("InvoiceId", "DeliveryId");
b.HasIndex("DeliveryId")
.IsUnique();
b.HasIndex("InvoiceId")
.IsUnique();
b.ToTable("InvoiceWebhookDeliveries");
});
modelBuilder.Entity("BTCPayServer.Data.LightningAddressData", b =>
{
b.Property<string>("Username")
.HasColumnType("text");
b.Property<byte[]>("Blob")
.HasColumnType("bytea");
b.Property<string>("Blob2")
.HasColumnType("JSONB");
b.Property<string>("StoreDataId")
.IsRequired()
.HasColumnType("text");
b.HasKey("Username");
b.HasIndex("StoreDataId");
b.ToTable("LightningAddresses");
});
modelBuilder.Entity("BTCPayServer.Data.NotificationData", b =>
{
b.Property<string>("Id")
.HasMaxLength(36)
.HasColumnType("character varying(36)");
b.Property<string>("ApplicationUserId")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<byte[]>("Blob")
.HasColumnType("bytea");
b.Property<string>("Blob2")
.HasColumnType("JSONB");
b.Property<DateTimeOffset>("Created")
.HasColumnType("timestamp with time zone");
b.Property<string>("NotificationType")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<bool>("Seen")
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("ApplicationUserId");
b.ToTable("Notifications");
});
modelBuilder.Entity("BTCPayServer.Data.OffchainTransactionData", b =>
{
b.Property<string>("Id")
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<byte[]>("Blob")
.HasColumnType("bytea");
b.HasKey("Id");
b.ToTable("OffchainTransactions");
});
modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Label")
.HasColumnType("text");
b.Property<DateTimeOffset>("PairingTime")
.HasColumnType("timestamp with time zone");
b.Property<string>("SIN")
.HasColumnType("text");
b.Property<string>("StoreDataId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("SIN");
b.HasIndex("StoreDataId");
b.ToTable("PairedSINData");
});
modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<DateTime>("DateCreated")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("Expiration")
.HasColumnType("timestamp with time zone");
b.Property<string>("Facade")
.HasColumnType("text");
b.Property<string>("Label")
.HasColumnType("text");
b.Property<string>("SIN")
.HasColumnType("text");
b.Property<string>("StoreDataId")
.HasColumnType("text");
b.Property<string>("TokenValue")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("PairingCodes");
});
modelBuilder.Entity("BTCPayServer.Data.PayjoinLock", b =>
{
b.Property<string>("Id")
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.HasKey("Id");
b.ToTable("PayjoinLocks");
});
modelBuilder.Entity("BTCPayServer.Data.PaymentData", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("PaymentMethodId")
.HasColumnType("text");
b.Property<bool?>("Accounted")
.HasColumnType("boolean");
b.Property<decimal?>("Amount")
.HasColumnType("NUMERIC");
b.Property<byte[]>("Blob")
.HasColumnType("bytea");
b.Property<string>("Blob2")
.HasColumnType("JSONB");
b.Property<DateTimeOffset?>("Created")
.HasColumnType("timestamp with time zone");
b.Property<string>("Currency")
.HasColumnType("text");
b.Property<string>("InvoiceDataId")
.HasColumnType("text");
b.Property<string>("Status")
.HasColumnType("text");
b.HasKey("Id", "PaymentMethodId");
b.HasIndex("InvoiceDataId");
b.ToTable("Payments");
});
modelBuilder.Entity("BTCPayServer.Data.PaymentRequestData", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<bool>("Archived")
.HasColumnType("boolean");
b.Property<byte[]>("Blob")
.HasColumnType("bytea");
b.Property<string>("Blob2")
.HasColumnType("JSONB");
b.Property<DateTimeOffset>("Created")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValue(new DateTimeOffset(new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));
b.Property<int>("Status")
.HasColumnType("integer");
b.Property<string>("StoreDataId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("Status");
b.HasIndex("StoreDataId");
b.ToTable("PaymentRequests");
});
modelBuilder.Entity("BTCPayServer.Data.PayoutData", b =>
{
b.Property<string>("Id")
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<decimal?>("Amount")
.HasColumnType("numeric");
b.Property<string>("Blob")
.HasColumnType("jsonb");
b.Property<string>("Currency")
.HasColumnType("text");
b.Property<DateTimeOffset>("Date")
.HasColumnType("timestamp with time zone");
b.Property<string>("DedupId")
.HasColumnType("text");
b.Property<decimal>("OriginalAmount")
.HasColumnType("numeric");
b.Property<string>("OriginalCurrency")
.HasColumnType("text");
b.Property<string>("PayoutMethodId")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property<string>("Proof")
.HasColumnType("JSONB");
b.Property<string>("PullPaymentDataId")
.HasColumnType("character varying(30)");
b.Property<string>("State")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property<string>("StoreDataId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("PullPaymentDataId");
b.HasIndex("State");
b.HasIndex("StoreDataId");
b.HasIndex("DedupId", "State");
b.ToTable("Payouts");
});
modelBuilder.Entity("BTCPayServer.Data.PayoutProcessorData", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("text");
b.Property<byte[]>("Blob")
.HasColumnType("bytea");
b.Property<string>("Blob2")
.HasColumnType("JSONB");
b.Property<string>("PayoutMethodId")
.HasColumnType("text");
b.Property<string>("Processor")
.HasColumnType("text");
b.Property<string>("StoreId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("StoreId");
b.ToTable("PayoutProcessors");
});
modelBuilder.Entity("BTCPayServer.Data.PendingTransaction", b =>
{
b.Property<string>("CryptoCode")
.HasColumnType("text");
b.Property<string>("TransactionId")
.HasColumnType("text");
b.Property<string>("Blob2")
.HasColumnType("JSONB");
b.Property<DateTimeOffset?>("Expiry")
.HasColumnType("timestamp with time zone");
b.Property<string[]>("OutpointsUsed")
.HasColumnType("text[]");
b.Property<int>("State")
.HasColumnType("integer");
b.Property<string>("StoreId")
.HasColumnType("text");
b.HasKey("CryptoCode", "TransactionId");
b.HasIndex("StoreId");
b.ToTable("PendingTransactions");
});
modelBuilder.Entity("BTCPayServer.Data.PlannedTransaction", b =>
{
b.Property<string>("Id")
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<byte[]>("Blob")
.HasColumnType("bytea");
b.Property<DateTimeOffset>("BroadcastAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("PlannedTransactions");
});
modelBuilder.Entity("BTCPayServer.Data.PullPaymentData", b =>
{
b.Property<string>("Id")
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<bool>("Archived")
.HasColumnType("boolean");
b.Property<string>("Blob")
.HasColumnType("JSONB");
b.Property<string>("Currency")
.HasColumnType("text");
b.Property<DateTimeOffset?>("EndDate")
.HasColumnType("timestamp with time zone");
b.Property<decimal>("Limit")
.HasColumnType("numeric");
b.Property<DateTimeOffset>("StartDate")
.HasColumnType("timestamp with time zone");
b.Property<string>("StoreId")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.HasIndex("StoreId");
b.ToTable("PullPayments");
});
modelBuilder.Entity("BTCPayServer.Data.RefundData", b =>
{
b.Property<string>("InvoiceDataId")
.HasColumnType("text");
b.Property<string>("PullPaymentDataId")
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.HasKey("InvoiceDataId", "PullPaymentDataId");
b.HasIndex("PullPaymentDataId");
b.ToTable("Refunds");
});
modelBuilder.Entity("BTCPayServer.Data.SettingData", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Value")
.HasColumnType("JSONB");
b.HasKey("Id");
b.ToTable("Settings");
});
modelBuilder.Entity("BTCPayServer.Data.StoreData", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<bool>("Archived")
.HasColumnType("boolean");
b.Property<string>("DefaultCrypto")
.HasColumnType("text");
b.Property<string>("DerivationStrategies")
.HasColumnType("JSONB");
b.Property<string>("DerivationStrategy")
.HasColumnType("text");
b.Property<int>("SpeedPolicy")
.HasColumnType("integer");
b.Property<string>("StoreBlob")
.HasColumnType("JSONB");
b.Property<byte[]>("StoreCertificate")
.HasColumnType("bytea");
b.Property<string>("StoreName")
.HasColumnType("text");
b.Property<string>("StoreWebsite")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Stores");
});
modelBuilder.Entity("BTCPayServer.Data.StoreRole", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<List<string>>("Permissions")
.HasColumnType("text[]");
b.Property<string>("Role")
.HasColumnType("text");
b.Property<string>("StoreDataId")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("StoreDataId", "Role")
.IsUnique();
b.ToTable("StoreRoles");
});
modelBuilder.Entity("BTCPayServer.Data.StoreSettingData", b =>
{
b.Property<string>("StoreId")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("Value")
.HasColumnType("JSONB");
b.HasKey("StoreId", "Name");
b.ToTable("StoreSettings");
});
modelBuilder.Entity("BTCPayServer.Data.StoreWebhookData", b =>
{
b.Property<string>("StoreId")
.HasColumnType("text");
b.Property<string>("WebhookId")
.HasColumnType("character varying(25)");
b.HasKey("StoreId", "WebhookId");
b.HasIndex("StoreId")
.IsUnique();
b.HasIndex("WebhookId")
.IsUnique();
b.ToTable("StoreWebhooks");
});
modelBuilder.Entity("BTCPayServer.Data.StoredFile", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("text");
b.Property<string>("ApplicationUserId")
.HasColumnType("text");
b.Property<string>("FileName")
.HasColumnType("text");
b.Property<string>("StorageFileName")
.HasColumnType("text");
b.Property<DateTime>("Timestamp")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("ApplicationUserId");
b.ToTable("Files");
});
modelBuilder.Entity("BTCPayServer.Data.U2FDevice", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("ApplicationUserId")
.HasColumnType("text");
b.Property<byte[]>("AttestationCert")
.IsRequired()
.HasColumnType("bytea");
b.Property<int>("Counter")
.HasColumnType("integer");
b.Property<byte[]>("KeyHandle")
.IsRequired()
.HasColumnType("bytea");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<byte[]>("PublicKey")
.IsRequired()
.HasColumnType("bytea");
b.HasKey("Id");
b.HasIndex("ApplicationUserId");
b.ToTable("U2FDevices");
});
modelBuilder.Entity("BTCPayServer.Data.UserStore", b =>
{
b.Property<string>("ApplicationUserId")
.HasColumnType("text");
b.Property<string>("StoreDataId")
.HasColumnType("text");
b.Property<string>("StoreRoleId")
.HasColumnType("text")
.HasColumnName("Role");
b.HasKey("ApplicationUserId", "StoreDataId");
b.HasIndex("StoreDataId");
b.HasIndex("StoreRoleId");
b.ToTable("UserStore");
});
modelBuilder.Entity("BTCPayServer.Data.WalletData", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<byte[]>("Blob")
.HasColumnType("bytea");
b.HasKey("Id");
b.ToTable("Wallets");
});
modelBuilder.Entity("BTCPayServer.Data.WalletObjectData", b =>
{
b.Property<string>("WalletId")
.HasColumnType("text");
b.Property<string>("Type")
.HasColumnType("text");
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("Data")
.HasColumnType("JSONB");
b.HasKey("WalletId", "Type", "Id");
b.HasIndex("Type", "Id");
b.ToTable("WalletObjects");
});
modelBuilder.Entity("BTCPayServer.Data.WalletObjectLinkData", b =>
{
b.Property<string>("WalletId")
.HasColumnType("text");
b.Property<string>("AType")
.HasColumnType("text");
b.Property<string>("AId")
.HasColumnType("text");
b.Property<string>("BType")
.HasColumnType("text");
b.Property<string>("BId")
.HasColumnType("text");
b.Property<string>("Data")
.HasColumnType("JSONB");
b.HasKey("WalletId", "AType", "AId", "BType", "BId");
b.HasIndex("WalletId", "BType", "BId");
b.ToTable("WalletObjectLinks");
});
modelBuilder.Entity("BTCPayServer.Data.WalletTransactionData", b =>
{
b.Property<string>("WalletDataId")
.HasColumnType("text");
b.Property<string>("TransactionId")
.HasColumnType("text");
b.Property<byte[]>("Blob")
.HasColumnType("bytea");
b.Property<string>("Labels")
.HasColumnType("text");
b.HasKey("WalletDataId", "TransactionId");
b.ToTable("WalletTransactions");
});
modelBuilder.Entity("BTCPayServer.Data.WebhookData", b =>
{
b.Property<string>("Id")
.HasMaxLength(25)
.HasColumnType("character varying(25)");
b.Property<byte[]>("Blob")
.HasColumnType("bytea");
b.Property<string>("Blob2")
.HasColumnType("JSONB");
b.HasKey("Id");
b.ToTable("Webhooks");
});
modelBuilder.Entity("BTCPayServer.Data.WebhookDeliveryData", b =>
{
b.Property<string>("Id")
.HasMaxLength(25)
.HasColumnType("character varying(25)");
b.Property<string>("Blob")
.HasColumnType("JSONB");
b.Property<bool>("Pruned")
.HasColumnType("boolean");
b.Property<DateTimeOffset>("Timestamp")
.HasColumnType("timestamp with time zone");
b.Property<string>("WebhookId")
.IsRequired()
.HasMaxLength(25)
.HasColumnType("character varying(25)");
b.HasKey("Id");
b.HasIndex("Timestamp");
b.HasIndex("WebhookId");
b.ToTable("WebhookDeliveries");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("text");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("text");
b.Property<string>("ProviderKey")
.HasColumnType("text");
b.Property<string>("ProviderDisplayName")
.HasColumnType("text");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("text");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("text");
b.Property<string>("RoleId")
.HasColumnType("text");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("text");
b.Property<string>("LoginProvider")
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("Value")
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("BTCPayServer.App.BackupStorage.AppStorageItemData", b =>
{
b.HasOne("BTCPayServer.Data.ApplicationUser", "User")
.WithMany("AppStorageItems")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b =>
{
b.HasOne("BTCPayServer.Data.StoreData", "StoreData")
.WithMany("APIKeys")
.HasForeignKey("StoreId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("BTCPayServer.Data.ApplicationUser", "User")
.WithMany("APIKeys")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("StoreData");
b.Navigation("User");
});
modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b =>
{
b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData")
.WithMany("AddressInvoices")
.HasForeignKey("InvoiceDataId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("InvoiceData");
});
modelBuilder.Entity("BTCPayServer.Data.AppData", b =>
{
b.HasOne("BTCPayServer.Data.StoreData", "StoreData")
.WithMany("Apps")
.HasForeignKey("StoreDataId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("StoreData");
});
modelBuilder.Entity("BTCPayServer.Data.Fido2Credential", b =>
{
b.HasOne("BTCPayServer.Data.ApplicationUser", "ApplicationUser")
.WithMany("Fido2Credentials")
.HasForeignKey("ApplicationUserId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("ApplicationUser");
});
modelBuilder.Entity("BTCPayServer.Data.FormData", b =>
{
b.HasOne("BTCPayServer.Data.StoreData", "Store")
.WithMany("Forms")
.HasForeignKey("StoreId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("Store");
});
modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b =>
{
b.HasOne("BTCPayServer.Data.StoreData", "StoreData")
.WithMany("Invoices")
.HasForeignKey("StoreDataId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("StoreData");
});
modelBuilder.Entity("BTCPayServer.Data.InvoiceSearchData", b =>
{
b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData")
.WithMany("InvoiceSearchData")
.HasForeignKey("InvoiceDataId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("InvoiceData");
});
modelBuilder.Entity("BTCPayServer.Data.InvoiceWebhookDeliveryData", b =>
{
b.HasOne("BTCPayServer.Data.WebhookDeliveryData", "Delivery")
.WithOne()
.HasForeignKey("BTCPayServer.Data.InvoiceWebhookDeliveryData", "DeliveryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BTCPayServer.Data.InvoiceData", "Invoice")
.WithOne()
.HasForeignKey("BTCPayServer.Data.InvoiceWebhookDeliveryData", "InvoiceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Delivery");
b.Navigation("Invoice");
});
modelBuilder.Entity("BTCPayServer.Data.LightningAddressData", b =>
{
b.HasOne("BTCPayServer.Data.StoreData", "Store")
.WithMany("LightningAddresses")
.HasForeignKey("StoreDataId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Store");
});
modelBuilder.Entity("BTCPayServer.Data.NotificationData", b =>
{
b.HasOne("BTCPayServer.Data.ApplicationUser", "ApplicationUser")
.WithMany("Notifications")
.HasForeignKey("ApplicationUserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ApplicationUser");
});
modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b =>
{
b.HasOne("BTCPayServer.Data.StoreData", "StoreData")
.WithMany("PairedSINs")
.HasForeignKey("StoreDataId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("StoreData");
});
modelBuilder.Entity("BTCPayServer.Data.PaymentData", b =>
{
b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData")
.WithMany("Payments")
.HasForeignKey("InvoiceDataId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("InvoiceData");
});
modelBuilder.Entity("BTCPayServer.Data.PaymentRequestData", b =>
{
b.HasOne("BTCPayServer.Data.StoreData", "StoreData")
.WithMany("PaymentRequests")
.HasForeignKey("StoreDataId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("StoreData");
});
modelBuilder.Entity("BTCPayServer.Data.PayoutData", b =>
{
b.HasOne("BTCPayServer.Data.PullPaymentData", "PullPaymentData")
.WithMany("Payouts")
.HasForeignKey("PullPaymentDataId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("BTCPayServer.Data.StoreData", "StoreData")
.WithMany("Payouts")
.HasForeignKey("StoreDataId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("PullPaymentData");
b.Navigation("StoreData");
});
modelBuilder.Entity("BTCPayServer.Data.PayoutProcessorData", b =>
{
b.HasOne("BTCPayServer.Data.StoreData", "Store")
.WithMany("PayoutProcessors")
.HasForeignKey("StoreId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("Store");
});
modelBuilder.Entity("BTCPayServer.Data.PendingTransaction", b =>
{
b.HasOne("BTCPayServer.Data.StoreData", "Store")
.WithMany("PendingTransactions")
.HasForeignKey("StoreId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("Store");
});
modelBuilder.Entity("BTCPayServer.Data.PullPaymentData", b =>
{
b.HasOne("BTCPayServer.Data.StoreData", "StoreData")
.WithMany("PullPayments")
.HasForeignKey("StoreId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("StoreData");
});
modelBuilder.Entity("BTCPayServer.Data.RefundData", b =>
{
b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData")
.WithMany("Refunds")
.HasForeignKey("InvoiceDataId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BTCPayServer.Data.PullPaymentData", "PullPaymentData")
.WithMany()
.HasForeignKey("PullPaymentDataId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("InvoiceData");
b.Navigation("PullPaymentData");
});
modelBuilder.Entity("BTCPayServer.Data.StoreRole", b =>
{
b.HasOne("BTCPayServer.Data.StoreData", "StoreData")
.WithMany("StoreRoles")
.HasForeignKey("StoreDataId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("StoreData");
});
modelBuilder.Entity("BTCPayServer.Data.StoreSettingData", b =>
{
b.HasOne("BTCPayServer.Data.StoreData", "Store")
.WithMany("Settings")
.HasForeignKey("StoreId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Store");
});
modelBuilder.Entity("BTCPayServer.Data.StoreWebhookData", b =>
{
b.HasOne("BTCPayServer.Data.StoreData", "Store")
.WithOne()
.HasForeignKey("BTCPayServer.Data.StoreWebhookData", "StoreId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BTCPayServer.Data.WebhookData", "Webhook")
.WithOne()
.HasForeignKey("BTCPayServer.Data.StoreWebhookData", "WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Store");
b.Navigation("Webhook");
});
modelBuilder.Entity("BTCPayServer.Data.StoredFile", b =>
{
b.HasOne("BTCPayServer.Data.ApplicationUser", "ApplicationUser")
.WithMany("StoredFiles")
.HasForeignKey("ApplicationUserId");
b.Navigation("ApplicationUser");
});
modelBuilder.Entity("BTCPayServer.Data.U2FDevice", b =>
{
b.HasOne("BTCPayServer.Data.ApplicationUser", "ApplicationUser")
.WithMany("U2FDevices")
.HasForeignKey("ApplicationUserId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("ApplicationUser");
});
modelBuilder.Entity("BTCPayServer.Data.UserStore", b =>
{
b.HasOne("BTCPayServer.Data.ApplicationUser", "ApplicationUser")
.WithMany("UserStores")
.HasForeignKey("ApplicationUserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BTCPayServer.Data.StoreData", "StoreData")
.WithMany("UserStores")
.HasForeignKey("StoreDataId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BTCPayServer.Data.StoreRole", "StoreRole")
.WithMany("Users")
.HasForeignKey("StoreRoleId");
b.Navigation("ApplicationUser");
b.Navigation("StoreData");
b.Navigation("StoreRole");
});
modelBuilder.Entity("BTCPayServer.Data.WalletObjectLinkData", b =>
{
b.HasOne("BTCPayServer.Data.WalletObjectData", "A")
.WithMany("Bs")
.HasForeignKey("WalletId", "AType", "AId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BTCPayServer.Data.WalletObjectData", "B")
.WithMany("As")
.HasForeignKey("WalletId", "BType", "BId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("A");
b.Navigation("B");
});
modelBuilder.Entity("BTCPayServer.Data.WalletTransactionData", b =>
{
b.HasOne("BTCPayServer.Data.WalletData", "WalletData")
.WithMany("WalletTransactions")
.HasForeignKey("WalletDataId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("WalletData");
});
modelBuilder.Entity("BTCPayServer.Data.WebhookDeliveryData", b =>
{
b.HasOne("BTCPayServer.Data.WebhookData", "Webhook")
.WithMany("Deliveries")
.HasForeignKey("WebhookId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Webhook");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("BTCPayServer.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("BTCPayServer.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BTCPayServer.Data.ApplicationUser", null)
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("BTCPayServer.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("BTCPayServer.Data.ApplicationUser", b =>
{
b.Navigation("APIKeys");
b.Navigation("AppStorageItems");
b.Navigation("Fido2Credentials");
b.Navigation("Notifications");
b.Navigation("StoredFiles");
b.Navigation("U2FDevices");
b.Navigation("UserRoles");
b.Navigation("UserStores");
});
modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b =>
{
b.Navigation("AddressInvoices");
b.Navigation("InvoiceSearchData");
b.Navigation("Payments");
b.Navigation("Refunds");
});
modelBuilder.Entity("BTCPayServer.Data.PullPaymentData", b =>
{
b.Navigation("Payouts");
});
modelBuilder.Entity("BTCPayServer.Data.StoreData", b =>
{
b.Navigation("APIKeys");
b.Navigation("Apps");
b.Navigation("Forms");
b.Navigation("Invoices");
b.Navigation("LightningAddresses");
b.Navigation("PairedSINs");
b.Navigation("PaymentRequests");
b.Navigation("PayoutProcessors");
b.Navigation("Payouts");
b.Navigation("PendingTransactions");
b.Navigation("PullPayments");
b.Navigation("Settings");
b.Navigation("StoreRoles");
b.Navigation("UserStores");
});
modelBuilder.Entity("BTCPayServer.Data.StoreRole", b =>
{
b.Navigation("Users");
});
modelBuilder.Entity("BTCPayServer.Data.WalletData", b =>
{
b.Navigation("WalletTransactions");
});
modelBuilder.Entity("BTCPayServer.Data.WalletObjectData", b =>
{
b.Navigation("As");
b.Navigation("Bs");
});
modelBuilder.Entity("BTCPayServer.Data.WebhookData", b =>
{
b.Navigation("Deliveries");
});
#pragma warning restore 612, 618
}
}
}