// 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.11") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => { b.Property("Id") .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("Blob") .HasColumnType("bytea"); b.Property("Blob2") .HasColumnType("JSONB"); b.Property("Label") .HasColumnType("text"); b.Property("StoreId") .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("Type") .HasColumnType("integer"); b.Property("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("Address") .HasColumnType("text"); b.Property("PaymentMethodId") .HasColumnType("text"); b.Property("InvoiceDataId") .HasColumnType("text"); b.HasKey("Address", "PaymentMethodId"); b.HasIndex("InvoiceDataId"); b.ToTable("AddressInvoices"); }); modelBuilder.Entity("BTCPayServer.Data.AppData", b => { b.Property("Id") .HasColumnType("text"); b.Property("AppType") .HasColumnType("text"); b.Property("Archived") .HasColumnType("boolean"); b.Property("Created") .HasColumnType("timestamp with time zone"); b.Property("Name") .HasColumnType("text"); b.Property("Settings") .HasColumnType("JSONB"); b.Property("StoreDataId") .HasColumnType("text"); b.Property("TagAllInvoices") .HasColumnType("boolean"); b.HasKey("Id"); b.HasIndex("StoreDataId"); b.ToTable("Apps"); }); modelBuilder.Entity("BTCPayServer.Data.ApplicationUser", b => { b.Property("Id") .HasColumnType("text"); b.Property("AccessFailedCount") .HasColumnType("integer"); b.Property("Approved") .HasColumnType("boolean"); b.Property("Blob") .HasColumnType("bytea"); b.Property("Blob2") .HasColumnType("JSONB"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("text"); b.Property("Created") .HasColumnType("timestamp with time zone"); b.Property("DisabledNotifications") .HasColumnType("text"); b.Property("Email") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("EmailConfirmed") .HasColumnType("boolean"); b.Property("LockoutEnabled") .HasColumnType("boolean"); b.Property("LockoutEnd") .HasColumnType("timestamp with time zone"); b.Property("NormalizedEmail") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("NormalizedUserName") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("PasswordHash") .HasColumnType("text"); b.Property("PhoneNumber") .HasColumnType("text"); b.Property("PhoneNumberConfirmed") .HasColumnType("boolean"); b.Property("RequiresApproval") .HasColumnType("boolean"); b.Property("RequiresEmailConfirmation") .HasColumnType("boolean"); b.Property("SecurityStamp") .HasColumnType("text"); b.Property("TwoFactorEnabled") .HasColumnType("boolean"); b.Property("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.CustomerData", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("text") .HasColumnName("id"); b.Property("AdditionalData") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("jsonb") .HasColumnName("additional_data") .HasDefaultValueSql("'{}'::jsonb"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("timestamptz") .HasColumnName("created_at") .HasDefaultValueSql("now()"); b.Property("ExternalRef") .HasColumnType("text") .HasColumnName("external_ref"); b.Property("Metadata") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("jsonb") .HasColumnName("metadata") .HasDefaultValueSql("'{}'::jsonb"); b.Property("Name") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("TEXT") .HasColumnName("name") .HasDefaultValueSql("''::TEXT"); b.Property("StoreId") .IsRequired() .HasColumnType("text") .HasColumnName("store_id"); b.HasKey("Id"); b.HasIndex("StoreId", "ExternalRef") .IsUnique(); b.ToTable("customers"); }); modelBuilder.Entity("BTCPayServer.Data.CustomerIdentityData", b => { b.Property("CustomerId") .HasColumnType("text") .HasColumnName("customer_id"); b.Property("Type") .HasColumnType("text") .HasColumnName("type"); b.Property("Value") .IsRequired() .HasColumnType("text") .HasColumnName("value"); b.HasKey("CustomerId", "Type"); b.ToTable("customers_identities"); }); modelBuilder.Entity("BTCPayServer.Data.EmailRuleData", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id")); b.Property("AdditionalData") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("jsonb") .HasColumnName("additional_data") .HasDefaultValueSql("'{}'::jsonb"); b.Property("BCC") .IsRequired() .HasColumnType("text[]") .HasColumnName("bcc"); b.Property("Body") .IsRequired() .HasColumnType("text") .HasColumnName("body"); b.Property("CC") .IsRequired() .HasColumnType("text[]") .HasColumnName("cc"); b.Property("Condition") .HasColumnType("text") .HasColumnName("condition"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("timestamptz") .HasColumnName("created_at") .HasDefaultValueSql("now()"); b.Property("Metadata") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("jsonb") .HasColumnName("metadata") .HasDefaultValueSql("'{}'::jsonb"); b.Property("OfferingId") .HasColumnType("text") .HasColumnName("offering_id"); b.Property("StoreId") .HasColumnType("text") .HasColumnName("store_id"); b.Property("Subject") .IsRequired() .HasColumnType("text") .HasColumnName("subject"); b.Property("To") .IsRequired() .HasColumnType("text[]") .HasColumnName("to"); b.Property("Trigger") .IsRequired() .HasColumnType("text") .HasColumnName("trigger"); b.HasKey("Id"); b.HasIndex("OfferingId"); b.HasIndex("StoreId"); b.ToTable("email_rules"); }); modelBuilder.Entity("BTCPayServer.Data.Fido2Credential", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("text"); b.Property("ApplicationUserId") .HasColumnType("text"); b.Property("Blob") .HasColumnType("bytea"); b.Property("Blob2") .HasColumnType("JSONB"); b.Property("Name") .HasColumnType("text"); b.Property("Type") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("ApplicationUserId"); b.ToTable("Fido2Credentials"); }); modelBuilder.Entity("BTCPayServer.Data.FormData", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("text"); b.Property("Config") .HasColumnType("JSONB"); b.Property("Name") .HasColumnType("text"); b.Property("Public") .HasColumnType("boolean"); b.Property("StoreId") .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("StoreId"); b.ToTable("Forms"); }); modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => { b.Property("Id") .HasColumnType("text"); b.Property("Amount") .HasColumnType("NUMERIC"); b.Property("Archived") .HasColumnType("boolean"); b.Property("Blob") .HasColumnType("bytea"); b.Property("Blob2") .HasColumnType("JSONB"); b.Property("Created") .HasColumnType("timestamp with time zone"); b.Property("Currency") .HasColumnType("text"); b.Property("ExceptionStatus") .HasColumnType("text"); b.Property("Status") .HasColumnType("text"); b.Property("StoreDataId") .HasColumnType("text"); b.Property("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("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasAnnotation("MySql:ValueGeneratedOnAdd", true) .HasAnnotation("Sqlite:Autoincrement", true); NpgsqlPropertyBuilderExtensions.UseSerialColumn(b.Property("Id")); b.Property("InvoiceDataId") .HasColumnType("text"); b.Property("Value") .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("InvoiceDataId"); b.HasIndex("Value"); b.ToTable("InvoiceSearches"); }); modelBuilder.Entity("BTCPayServer.Data.InvoiceWebhookDeliveryData", b => { b.Property("InvoiceId") .HasColumnType("text"); b.Property("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("Username") .HasColumnType("text"); b.Property("Blob") .HasColumnType("bytea"); b.Property("Blob2") .HasColumnType("JSONB"); b.Property("StoreDataId") .IsRequired() .HasColumnType("text"); b.HasKey("Username"); b.HasIndex("StoreDataId"); b.ToTable("LightningAddresses"); }); modelBuilder.Entity("BTCPayServer.Data.NotificationData", b => { b.Property("Id") .HasMaxLength(36) .HasColumnType("character varying(36)"); b.Property("ApplicationUserId") .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("Blob") .HasColumnType("bytea"); b.Property("Blob2") .HasColumnType("JSONB"); b.Property("Created") .HasColumnType("timestamp with time zone"); b.Property("NotificationType") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("Seen") .HasColumnType("boolean"); b.HasKey("Id"); b.HasIndex("ApplicationUserId"); b.ToTable("Notifications"); }); modelBuilder.Entity("BTCPayServer.Data.OffchainTransactionData", b => { b.Property("Id") .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("Blob") .HasColumnType("bytea"); b.HasKey("Id"); b.ToTable("OffchainTransactions"); }); modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => { b.Property("Id") .HasColumnType("text"); b.Property("Label") .HasColumnType("text"); b.Property("PairingTime") .HasColumnType("timestamp with time zone"); b.Property("SIN") .HasColumnType("text"); b.Property("StoreDataId") .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("SIN"); b.HasIndex("StoreDataId"); b.ToTable("PairedSINData"); }); modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => { b.Property("Id") .HasColumnType("text"); b.Property("DateCreated") .HasColumnType("timestamp with time zone"); b.Property("Expiration") .HasColumnType("timestamp with time zone"); b.Property("Facade") .HasColumnType("text"); b.Property("Label") .HasColumnType("text"); b.Property("SIN") .HasColumnType("text"); b.Property("StoreDataId") .HasColumnType("text"); b.Property("TokenValue") .HasColumnType("text"); b.HasKey("Id"); b.ToTable("PairingCodes"); }); modelBuilder.Entity("BTCPayServer.Data.PayjoinLock", b => { b.Property("Id") .HasMaxLength(100) .HasColumnType("character varying(100)"); b.HasKey("Id"); b.ToTable("PayjoinLocks"); }); modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => { b.Property("Id") .HasColumnType("text"); b.Property("PaymentMethodId") .HasColumnType("text"); b.Property("Accounted") .HasColumnType("boolean"); b.Property("Amount") .HasColumnType("NUMERIC"); b.Property("Blob") .HasColumnType("bytea"); b.Property("Blob2") .HasColumnType("JSONB"); b.Property("Created") .HasColumnType("timestamp with time zone"); b.Property("Currency") .HasColumnType("text"); b.Property("InvoiceDataId") .HasColumnType("text"); b.Property("Status") .HasColumnType("text"); b.HasKey("Id", "PaymentMethodId"); b.HasIndex("InvoiceDataId"); b.ToTable("Payments"); }); modelBuilder.Entity("BTCPayServer.Data.PaymentRequestData", b => { b.Property("Id") .HasColumnType("text"); b.Property("Amount") .HasColumnType("numeric"); b.Property("Archived") .HasColumnType("boolean"); b.Property("Blob") .HasColumnType("bytea"); b.Property("Blob2") .HasColumnType("JSONB"); b.Property("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("Currency") .HasColumnType("text"); b.Property("Expiry") .HasColumnType("timestamp with time zone"); b.Property("ReferenceId") .HasColumnType("text"); b.Property("Status") .IsRequired() .HasColumnType("text"); b.Property("StoreDataId") .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("Status"); b.HasIndex("StoreDataId"); b.ToTable("PaymentRequests"); }); modelBuilder.Entity("BTCPayServer.Data.PayoutData", b => { b.Property("Id") .HasMaxLength(30) .HasColumnType("character varying(30)"); b.Property("Amount") .HasColumnType("numeric"); b.Property("Blob") .HasColumnType("jsonb"); b.Property("Currency") .HasColumnType("text"); b.Property("Date") .HasColumnType("timestamp with time zone"); b.Property("DedupId") .HasColumnType("text"); b.Property("OriginalAmount") .HasColumnType("numeric"); b.Property("OriginalCurrency") .HasColumnType("text"); b.Property("PayoutMethodId") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("Proof") .HasColumnType("JSONB"); b.Property("PullPaymentDataId") .HasColumnType("character varying(30)"); b.Property("State") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("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("Id") .ValueGeneratedOnAdd() .HasColumnType("text"); b.Property("Blob") .HasColumnType("bytea"); b.Property("Blob2") .HasColumnType("JSONB"); b.Property("PayoutMethodId") .HasColumnType("text"); b.Property("Processor") .HasColumnType("text"); b.Property("StoreId") .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("StoreId"); b.ToTable("PayoutProcessors"); }); modelBuilder.Entity("BTCPayServer.Data.PendingTransaction", b => { b.Property("Id") .HasColumnType("text"); b.Property("Blob2") .HasColumnType("JSONB"); b.Property("CryptoCode") .HasColumnType("text"); b.Property("Expiry") .HasColumnType("timestamp with time zone"); b.Property("OutpointsUsed") .HasColumnType("text[]"); b.Property("State") .HasColumnType("integer"); b.Property("StoreId") .HasColumnType("text"); b.Property("TransactionId") .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("StoreId"); b.HasIndex("TransactionId"); b.ToTable("PendingTransactions"); }); modelBuilder.Entity("BTCPayServer.Data.PlannedTransaction", b => { b.Property("Id") .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("Blob") .HasColumnType("bytea"); b.Property("BroadcastAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.ToTable("PlannedTransactions"); }); modelBuilder.Entity("BTCPayServer.Data.PullPaymentData", b => { b.Property("Id") .HasMaxLength(30) .HasColumnType("character varying(30)"); b.Property("Archived") .HasColumnType("boolean"); b.Property("Blob") .HasColumnType("JSONB"); b.Property("Currency") .HasColumnType("text"); b.Property("EndDate") .HasColumnType("timestamp with time zone"); b.Property("Limit") .HasColumnType("numeric"); b.Property("StartDate") .HasColumnType("timestamp with time zone"); b.Property("StoreId") .HasMaxLength(50) .HasColumnType("character varying(50)"); b.HasKey("Id"); b.HasIndex("StoreId"); b.ToTable("PullPayments"); }); modelBuilder.Entity("BTCPayServer.Data.RefundData", b => { b.Property("InvoiceDataId") .HasColumnType("text"); b.Property("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("Id") .HasColumnType("text"); b.Property("Value") .HasColumnType("JSONB"); b.HasKey("Id"); b.ToTable("Settings"); }); modelBuilder.Entity("BTCPayServer.Data.StoreData", b => { b.Property("Id") .HasColumnType("text"); b.Property("Archived") .HasColumnType("boolean"); b.Property("DefaultCrypto") .HasColumnType("text"); b.Property("DerivationStrategies") .HasColumnType("JSONB"); b.Property("DerivationStrategy") .HasColumnType("text"); b.Property("SpeedPolicy") .HasColumnType("integer"); b.Property("StoreBlob") .HasColumnType("JSONB"); b.Property("StoreCertificate") .HasColumnType("bytea"); b.Property("StoreName") .HasColumnType("text"); b.Property("StoreWebsite") .HasColumnType("text"); b.HasKey("Id"); b.ToTable("Stores"); }); modelBuilder.Entity("BTCPayServer.Data.StoreRole", b => { b.Property("Id") .HasColumnType("text"); b.Property>("Permissions") .HasColumnType("text[]"); b.Property("Role") .HasColumnType("text"); b.Property("StoreDataId") .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("StoreDataId", "Role") .IsUnique(); b.ToTable("StoreRoles"); }); modelBuilder.Entity("BTCPayServer.Data.StoreSettingData", b => { b.Property("StoreId") .HasColumnType("text"); b.Property("Name") .HasColumnType("text"); b.Property("Value") .HasColumnType("JSONB"); b.HasKey("StoreId", "Name"); b.ToTable("StoreSettings"); }); modelBuilder.Entity("BTCPayServer.Data.StoreWebhookData", b => { b.Property("StoreId") .HasColumnType("text"); b.Property("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("Id") .ValueGeneratedOnAdd() .HasColumnType("text"); b.Property("ApplicationUserId") .HasColumnType("text"); b.Property("FileName") .HasColumnType("text"); b.Property("StorageFileName") .HasColumnType("text"); b.Property("Timestamp") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("ApplicationUserId"); b.ToTable("Files"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.EntitlementData", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasColumnName("id"); NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id")); b.Property("CustomId") .IsRequired() .HasColumnType("text") .HasColumnName("custom_id"); b.Property("Description") .HasColumnType("text") .HasColumnName("description"); b.Property("OfferingId") .IsRequired() .HasColumnType("text") .HasColumnName("offering_id"); b.HasKey("Id"); b.HasIndex("OfferingId", "CustomId") .IsUnique(); b.ToTable("subs_entitlements"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.OfferingData", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("text") .HasColumnName("id"); b.Property("AdditionalData") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("jsonb") .HasColumnName("additional_data") .HasDefaultValueSql("'{}'::jsonb"); b.Property("AppId") .IsRequired() .HasColumnType("text") .HasColumnName("app_id"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("timestamptz") .HasColumnName("created_at") .HasDefaultValueSql("now()"); b.Property("DefaultPaymentRemindersDays") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasDefaultValue(3) .HasColumnName("payment_reminder_days"); b.Property("Metadata") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("jsonb") .HasColumnName("metadata") .HasDefaultValueSql("'{}'::jsonb"); b.Property("SuccessRedirectUrl") .HasColumnType("text") .HasColumnName("success_redirect_url"); b.HasKey("Id"); b.HasIndex("AppId"); b.ToTable("subs_offerings"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.PlanChangeData", b => { b.Property("PlanId") .HasColumnType("text") .HasColumnName("plan_id"); b.Property("PlanChangeId") .HasColumnType("text") .HasColumnName("plan_change_id"); b.Property("Type") .IsRequired() .HasColumnType("text") .HasColumnName("type"); b.HasKey("PlanId", "PlanChangeId"); b.HasIndex("PlanChangeId"); b.ToTable("subs_plan_changes"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.PlanCheckoutData", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("text") .HasColumnName("id"); b.Property("AdditionalData") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("jsonb") .HasColumnName("additional_data") .HasDefaultValueSql("'{}'::jsonb"); b.Property("BaseUrl") .IsRequired() .HasColumnType("text") .HasColumnName("base_url"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("timestamptz") .HasColumnName("created_at") .HasDefaultValueSql("now()"); b.Property("Credited") .HasColumnType("numeric") .HasColumnName("credited"); b.Property("Expiration") .ValueGeneratedOnAdd() .HasColumnType("timestamp with time zone") .HasColumnName("expiration") .HasDefaultValueSql("now() + interval '1 day'"); b.Property("InvoiceId") .HasColumnType("text") .HasColumnName("invoice_id"); b.Property("InvoiceMetadata") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("jsonb") .HasColumnName("invoice_metadata") .HasDefaultValueSql("'{}'::jsonb"); b.Property("IsTrial") .ValueGeneratedOnAdd() .HasColumnType("boolean") .HasDefaultValue(false) .HasColumnName("is_trial"); b.Property("Metadata") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("jsonb") .HasColumnName("metadata") .HasDefaultValueSql("'{}'::jsonb"); b.Property("NewSubscriber") .HasColumnType("boolean") .HasColumnName("new_subscriber"); b.Property("NewSubscriberMetadata") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("jsonb") .HasColumnName("new_subscriber_metadata") .HasDefaultValueSql("'{}'::jsonb"); b.Property("OnPay") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("text") .HasDefaultValue("SoftMigration") .HasColumnName("on_pay"); b.Property("PlanId") .IsRequired() .HasColumnType("text") .HasColumnName("plan_id"); b.Property("PlanStarted") .HasColumnType("boolean") .HasColumnName("plan_started"); b.Property("RefundAmount") .HasColumnType("numeric") .HasColumnName("refund_amount"); b.Property("SubscriberId") .HasColumnType("bigint") .HasColumnName("subscriber_id"); b.Property("SuccessRedirectUrl") .HasColumnType("text") .HasColumnName("success_redirect_url"); b.Property("TestAccount") .HasColumnType("boolean") .HasColumnName("test_account"); b.HasKey("Id"); b.HasIndex("Expiration"); b.HasIndex("InvoiceId"); b.HasIndex("PlanId"); b.HasIndex("SubscriberId"); b.ToTable("subs_plan_checkouts"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.PlanData", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("text") .HasColumnName("id"); b.Property("AdditionalData") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("jsonb") .HasColumnName("additional_data") .HasDefaultValueSql("'{}'::jsonb"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("timestamptz") .HasColumnName("created_at") .HasDefaultValueSql("now()"); b.Property("Currency") .IsRequired() .HasColumnType("text") .HasColumnName("currency"); b.Property("Description") .HasColumnType("text") .HasColumnName("description"); b.Property("GracePeriodDays") .HasColumnType("integer") .HasColumnName("grace_period_days"); b.Property("MemberCount") .HasColumnType("integer") .HasColumnName("members_count"); b.Property("Metadata") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("jsonb") .HasColumnName("metadata") .HasDefaultValueSql("'{}'::jsonb"); b.Property("MonthlyRevenue") .HasColumnType("numeric") .HasColumnName("monthly_revenue"); b.Property("Name") .IsRequired() .HasColumnType("text") .HasColumnName("name"); b.Property("OfferingId") .IsRequired() .HasColumnType("text") .HasColumnName("offering_id"); b.Property("OptimisticActivation") .ValueGeneratedOnAdd() .HasColumnType("boolean") .HasDefaultValue(true) .HasColumnName("optimistic_activation"); b.Property("Price") .HasColumnType("numeric") .HasColumnName("price"); b.Property("RecurringType") .IsRequired() .HasColumnType("text") .HasColumnName("recurring_type"); b.Property("Renewable") .ValueGeneratedOnAdd() .HasColumnType("boolean") .HasDefaultValue(true) .HasColumnName("renewable"); b.Property("Status") .IsRequired() .HasColumnType("text") .HasColumnName("status"); b.Property("TrialDays") .HasColumnType("integer") .HasColumnName("trial_days"); b.HasKey("Id"); b.HasIndex("OfferingId"); b.ToTable("subs_plans"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.PlanEntitlementData", b => { b.Property("PlanId") .HasColumnType("text") .HasColumnName("plan_id"); b.Property("EntitlementId") .HasColumnType("bigint") .HasColumnName("entitlement_id"); b.HasKey("PlanId", "EntitlementId"); b.HasIndex("EntitlementId"); b.ToTable("subs_plans_entitlements"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.PortalSessionData", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("text") .HasColumnName("id"); b.Property("BaseUrl") .IsRequired() .HasColumnType("text") .HasColumnName("base_url"); b.Property("Expiration") .HasColumnType("timestamp with time zone") .HasColumnName("expiration"); b.Property("SubscriberId") .HasColumnType("bigint") .HasColumnName("subscriber_id"); b.HasKey("Id"); b.HasIndex("Expiration"); b.HasIndex("SubscriberId"); b.ToTable("subs_portal_sessions"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.SubscriberCredit", b => { b.Property("SubscriberId") .HasColumnType("bigint") .HasColumnName("subscriber_id"); b.Property("Currency") .HasColumnType("text") .HasColumnName("currency"); b.Property("Amount") .HasColumnType("numeric") .HasColumnName("amount"); b.HasKey("SubscriberId", "Currency"); b.ToTable("subs_subscriber_credits"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.SubscriberCreditHistoryData", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id")); b.Property("Balance") .HasColumnType("numeric") .HasColumnName("balance"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("timestamptz") .HasColumnName("created_at") .HasDefaultValueSql("now()"); b.Property("Credit") .HasColumnType("numeric") .HasColumnName("credit"); b.Property("Currency") .IsRequired() .HasColumnType("text") .HasColumnName("currency"); b.Property("Debit") .HasColumnType("numeric") .HasColumnName("debit"); b.Property("Description") .IsRequired() .HasColumnType("text") .HasColumnName("description"); b.Property("SubscriberId") .HasColumnType("bigint") .HasColumnName("subscriber_id"); b.HasKey("Id"); b.HasIndex("SubscriberId", "CreatedAt") .IsDescending(); b.HasIndex("SubscriberId", "Currency"); b.ToTable("subs_subscriber_credits_history"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.SubscriberData", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasColumnName("id"); NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id")); b.Property("AdditionalData") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("jsonb") .HasColumnName("additional_data") .HasDefaultValueSql("'{}'::jsonb"); b.Property("AutoRenew") .ValueGeneratedOnAdd() .HasColumnType("boolean") .HasDefaultValue(true) .HasColumnName("auto_renew"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("timestamptz") .HasColumnName("created_at") .HasDefaultValueSql("now()"); b.Property("CustomerId") .IsRequired() .HasColumnType("text") .HasColumnName("customer_id"); b.Property("GracePeriodEnd") .HasColumnType("timestamp with time zone") .HasColumnName("grace_period_end"); b.Property("IsActive") .ValueGeneratedOnAdd() .HasColumnType("boolean") .HasDefaultValue(false) .HasColumnName("active"); b.Property("IsSuspended") .ValueGeneratedOnAdd() .HasColumnType("boolean") .HasDefaultValue(false) .HasColumnName("suspended"); b.Property("Metadata") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("jsonb") .HasColumnName("metadata") .HasDefaultValueSql("'{}'::jsonb"); b.Property("NewPlanId") .HasColumnType("text") .HasColumnName("new_plan_id"); b.Property("OfferingId") .IsRequired() .HasColumnType("text") .HasColumnName("offering_id"); b.Property("OptimisticActivation") .HasColumnType("boolean") .HasColumnName("optimistic_activation"); b.Property("PaidAmount") .HasColumnType("numeric") .HasColumnName("paid_amount"); b.Property("PaymentReminded") .ValueGeneratedOnAdd() .HasColumnType("boolean") .HasDefaultValue(false) .HasColumnName("payment_reminded"); b.Property("PaymentReminderDays") .HasColumnType("integer") .HasColumnName("payment_reminder_days"); b.Property("PeriodEnd") .HasColumnType("timestamp with time zone") .HasColumnName("period_end"); b.Property("Phase") .IsRequired() .ValueGeneratedOnAdd() .HasColumnType("text") .HasColumnName("phase") .HasDefaultValueSql("'Expired'::TEXT"); b.Property("PlanId") .IsRequired() .HasColumnType("text") .HasColumnName("plan_id"); b.Property("PlanStarted") .ValueGeneratedOnAdd() .HasColumnType("timestamp with time zone") .HasColumnName("plan_started") .HasDefaultValueSql("now()"); b.Property("SuspensionReason") .HasColumnType("text") .HasColumnName("suspension_reason"); b.Property("TestAccount") .ValueGeneratedOnAdd() .HasColumnType("boolean") .HasDefaultValue(false) .HasColumnName("test_account"); b.Property("TrialEnd") .HasColumnType("timestamp with time zone") .HasColumnName("trial_end"); b.HasKey("Id"); b.HasIndex("CustomerId"); b.HasIndex("NewPlanId"); b.HasIndex("PlanId"); b.HasIndex("OfferingId", "CustomerId") .IsUnique(); b.ToTable("subs_subscribers"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.SubscriberInvoiceData", b => { b.Property("SubscriberId") .HasColumnType("bigint") .HasColumnName("subscriber_id"); b.Property("InvoiceId") .HasColumnType("text") .HasColumnName("invoice_id"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("timestamptz") .HasColumnName("created_at") .HasDefaultValueSql("now()"); b.HasKey("SubscriberId", "InvoiceId"); b.HasIndex("InvoiceId"); b.HasIndex("SubscriberId", "CreatedAt"); b.ToTable("subscriber_invoices"); }); modelBuilder.Entity("BTCPayServer.Data.U2FDevice", b => { b.Property("Id") .HasColumnType("text"); b.Property("ApplicationUserId") .HasColumnType("text"); b.Property("AttestationCert") .IsRequired() .HasColumnType("bytea"); b.Property("Counter") .HasColumnType("integer"); b.Property("KeyHandle") .IsRequired() .HasColumnType("bytea"); b.Property("Name") .HasColumnType("text"); b.Property("PublicKey") .IsRequired() .HasColumnType("bytea"); b.HasKey("Id"); b.HasIndex("ApplicationUserId"); b.ToTable("U2FDevices"); }); modelBuilder.Entity("BTCPayServer.Data.UserStore", b => { b.Property("ApplicationUserId") .HasColumnType("text"); b.Property("StoreDataId") .HasColumnType("text"); b.Property("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("Id") .HasColumnType("text"); b.Property("Blob") .HasColumnType("bytea"); b.HasKey("Id"); b.ToTable("Wallets"); }); modelBuilder.Entity("BTCPayServer.Data.WalletObjectData", b => { b.Property("WalletId") .HasColumnType("text"); b.Property("Type") .HasColumnType("text"); b.Property("Id") .HasColumnType("text"); b.Property("Data") .HasColumnType("JSONB"); b.Property("XMin") .IsConcurrencyToken() .ValueGeneratedOnAddOrUpdate() .HasColumnType("xid") .HasColumnName("xmin"); b.HasKey("WalletId", "Type", "Id"); b.HasIndex("Type", "Id"); b.ToTable("WalletObjects"); }); modelBuilder.Entity("BTCPayServer.Data.WalletObjectLinkData", b => { b.Property("WalletId") .HasColumnType("text"); b.Property("AType") .HasColumnType("text"); b.Property("AId") .HasColumnType("text"); b.Property("BType") .HasColumnType("text"); b.Property("BId") .HasColumnType("text"); b.Property("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("WalletDataId") .HasColumnType("text"); b.Property("TransactionId") .HasColumnType("text"); b.Property("Blob") .HasColumnType("bytea"); b.Property("Labels") .HasColumnType("text"); b.HasKey("WalletDataId", "TransactionId"); b.ToTable("WalletTransactions"); }); modelBuilder.Entity("BTCPayServer.Data.WebhookData", b => { b.Property("Id") .HasMaxLength(25) .HasColumnType("character varying(25)"); b.Property("Blob") .HasColumnType("bytea"); b.Property("Blob2") .HasColumnType("JSONB"); b.HasKey("Id"); b.ToTable("Webhooks"); }); modelBuilder.Entity("BTCPayServer.Data.WebhookDeliveryData", b => { b.Property("Id") .HasMaxLength(25) .HasColumnType("character varying(25)"); b.Property("Blob") .HasColumnType("JSONB"); b.Property("Pruned") .HasColumnType("boolean"); b.Property("Timestamp") .HasColumnType("timestamp with time zone"); b.Property("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("Id") .HasColumnType("text"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("text"); b.Property("Name") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("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", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ClaimType") .HasColumnType("text"); b.Property("ClaimValue") .HasColumnType("text"); b.Property("RoleId") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("AspNetRoleClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ClaimType") .HasColumnType("text"); b.Property("ClaimValue") .HasColumnType("text"); b.Property("UserId") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("AspNetUserClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.Property("LoginProvider") .HasColumnType("text"); b.Property("ProviderKey") .HasColumnType("text"); b.Property("ProviderDisplayName") .HasColumnType("text"); b.Property("UserId") .IsRequired() .HasColumnType("text"); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); b.ToTable("AspNetUserLogins", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.Property("UserId") .HasColumnType("text"); b.Property("RoleId") .HasColumnType("text"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); b.ToTable("AspNetUserRoles", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.Property("UserId") .HasColumnType("text"); b.Property("LoginProvider") .HasColumnType("text"); b.Property("Name") .HasColumnType("text"); b.Property("Value") .HasColumnType("text"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("AspNetUserTokens", (string)null); }); 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.CustomerData", b => { b.HasOne("BTCPayServer.Data.StoreData", "Store") .WithMany() .HasForeignKey("StoreId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Store"); }); modelBuilder.Entity("BTCPayServer.Data.CustomerIdentityData", b => { b.HasOne("BTCPayServer.Data.CustomerData", "Customer") .WithMany("CustomerIdentities") .HasForeignKey("CustomerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Customer"); }); modelBuilder.Entity("BTCPayServer.Data.EmailRuleData", b => { b.HasOne("BTCPayServer.Data.Subscriptions.OfferingData", "Offering") .WithMany() .HasForeignKey("OfferingId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("BTCPayServer.Data.StoreData", "Store") .WithMany() .HasForeignKey("StoreId") .OnDelete(DeleteBehavior.Cascade); b.Navigation("Offering"); b.Navigation("Store"); }); 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.Subscriptions.EntitlementData", b => { b.HasOne("BTCPayServer.Data.Subscriptions.OfferingData", "Offering") .WithMany("Entitlements") .HasForeignKey("OfferingId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Offering"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.OfferingData", b => { b.HasOne("BTCPayServer.Data.AppData", "App") .WithMany() .HasForeignKey("AppId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("App"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.PlanChangeData", b => { b.HasOne("BTCPayServer.Data.Subscriptions.PlanData", "PlanChange") .WithMany() .HasForeignKey("PlanChangeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("BTCPayServer.Data.Subscriptions.PlanData", "Plan") .WithMany("PlanChanges") .HasForeignKey("PlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Plan"); b.Navigation("PlanChange"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.PlanCheckoutData", b => { b.HasOne("BTCPayServer.Data.InvoiceData", "Invoice") .WithMany() .HasForeignKey("InvoiceId") .OnDelete(DeleteBehavior.SetNull); b.HasOne("BTCPayServer.Data.Subscriptions.PlanData", "Plan") .WithMany() .HasForeignKey("PlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("BTCPayServer.Data.Subscriptions.SubscriberData", "Subscriber") .WithMany() .HasForeignKey("SubscriberId") .OnDelete(DeleteBehavior.SetNull); b.Navigation("Invoice"); b.Navigation("Plan"); b.Navigation("Subscriber"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.PlanData", b => { b.HasOne("BTCPayServer.Data.Subscriptions.OfferingData", "Offering") .WithMany("Plans") .HasForeignKey("OfferingId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Offering"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.PlanEntitlementData", b => { b.HasOne("BTCPayServer.Data.Subscriptions.EntitlementData", "Entitlement") .WithMany() .HasForeignKey("EntitlementId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("BTCPayServer.Data.Subscriptions.PlanData", "Plan") .WithMany() .HasForeignKey("PlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Entitlement"); b.Navigation("Plan"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.PortalSessionData", b => { b.HasOne("BTCPayServer.Data.Subscriptions.SubscriberData", "Subscriber") .WithMany() .HasForeignKey("SubscriberId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Subscriber"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.SubscriberCredit", b => { b.HasOne("BTCPayServer.Data.Subscriptions.SubscriberData", "Subscriber") .WithMany("Credits") .HasForeignKey("SubscriberId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Subscriber"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.SubscriberCreditHistoryData", b => { b.HasOne("BTCPayServer.Data.Subscriptions.SubscriberCredit", "SubscriberCredit") .WithMany() .HasForeignKey("SubscriberId", "Currency") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("SubscriberCredit"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.SubscriberData", b => { b.HasOne("BTCPayServer.Data.CustomerData", "Customer") .WithMany() .HasForeignKey("CustomerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("BTCPayServer.Data.Subscriptions.PlanData", "NewPlan") .WithMany() .HasForeignKey("NewPlanId") .OnDelete(DeleteBehavior.SetNull); b.HasOne("BTCPayServer.Data.Subscriptions.OfferingData", "Offering") .WithMany("Subscribers") .HasForeignKey("OfferingId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("BTCPayServer.Data.Subscriptions.PlanData", "Plan") .WithMany("Subscriptions") .HasForeignKey("PlanId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Customer"); b.Navigation("NewPlan"); b.Navigation("Offering"); b.Navigation("Plan"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.SubscriberInvoiceData", b => { b.HasOne("BTCPayServer.Data.InvoiceData", "Invoice") .WithMany() .HasForeignKey("InvoiceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("BTCPayServer.Data.Subscriptions.SubscriberData", "Subscriber") .WithMany() .HasForeignKey("SubscriberId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Invoice"); b.Navigation("Subscriber"); }); 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", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.HasOne("BTCPayServer.Data.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.HasOne("BTCPayServer.Data.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", 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", 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("Fido2Credentials"); b.Navigation("Notifications"); b.Navigation("StoredFiles"); b.Navigation("U2FDevices"); b.Navigation("UserRoles"); b.Navigation("UserStores"); }); modelBuilder.Entity("BTCPayServer.Data.CustomerData", b => { b.Navigation("CustomerIdentities"); }); 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.Subscriptions.OfferingData", b => { b.Navigation("Entitlements"); b.Navigation("Plans"); b.Navigation("Subscribers"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.PlanData", b => { b.Navigation("PlanChanges"); b.Navigation("Subscriptions"); }); modelBuilder.Entity("BTCPayServer.Data.Subscriptions.SubscriberData", b => { b.Navigation("Credits"); }); 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 } } }