diff --git a/BTCPayServer.Data/BTCPayServer.Data.csproj b/BTCPayServer.Data/BTCPayServer.Data.csproj
index a87e1ddd2..ba80cab0d 100644
--- a/BTCPayServer.Data/BTCPayServer.Data.csproj
+++ b/BTCPayServer.Data/BTCPayServer.Data.csproj
@@ -6,14 +6,14 @@
-
+
-
-
-
-
-
+
+
+
+
+
diff --git a/BTCPayServer.Data/Migrations/20200110064617_OpenIddictUpdate.cs b/BTCPayServer.Data/Migrations/20200110064617_OpenIddictUpdate.cs
new file mode 100644
index 000000000..1e10e1a7e
--- /dev/null
+++ b/BTCPayServer.Data/Migrations/20200110064617_OpenIddictUpdate.cs
@@ -0,0 +1,60 @@
+using BTCPayServer.Data;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace BTCPayServer.Migrations
+{
+ [DbContext(typeof(ApplicationDbContext))]
+ [Migration("20200110064617_OpenIddictUpdate")]
+ public partial class OpenIddictUpdate : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AlterColumn(
+ name: "Subject",
+ table: "OpenIddictTokens",
+ maxLength: 450,
+ nullable: true,
+ oldClrType: typeof(string),
+ oldMaxLength: 450);
+
+ migrationBuilder.AlterColumn(
+ name: "Subject",
+ table: "OpenIddictAuthorizations",
+ maxLength: 450,
+ nullable: true,
+ oldClrType: typeof(string),
+ oldMaxLength: 450);
+
+ migrationBuilder.AddColumn(
+ name: "Requirements",
+ table: "OpenIddictApplications",
+ nullable: true);
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropColumn(
+ name: "Requirements",
+ table: "OpenIddictApplications");
+
+ migrationBuilder.AlterColumn(
+ name: "Subject",
+ table: "OpenIddictTokens",
+ maxLength: 450,
+ nullable: false,
+ oldClrType: typeof(string),
+ oldMaxLength: 450,
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "Subject",
+ table: "OpenIddictAuthorizations",
+ maxLength: 450,
+ nullable: false,
+ oldClrType: typeof(string),
+ oldMaxLength: 450,
+ oldNullable: true);
+ }
+ }
+}
diff --git a/BTCPayServer.Data/Migrations/ApplicationDbContextModelSnapshot.cs b/BTCPayServer.Data/Migrations/ApplicationDbContextModelSnapshot.cs
index 6aacb5462..e8ee803b4 100644
--- a/BTCPayServer.Data/Migrations/ApplicationDbContextModelSnapshot.cs
+++ b/BTCPayServer.Data/Migrations/ApplicationDbContextModelSnapshot.cs
@@ -14,869 +14,869 @@ namespace BTCPayServer.Migrations
{
#pragma warning disable 612, 618
modelBuilder
- .HasAnnotation("ProductVersion", "2.1.11-servicing-32099");
+ .HasAnnotation("ProductVersion", "2.1.14-servicing-32113");
modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b =>
- {
- b.Property("Address")
- .ValueGeneratedOnAdd();
+ {
+ b.Property("Address")
+ .ValueGeneratedOnAdd();
- b.Property("CreatedTime");
+ b.Property("CreatedTime");
- b.Property("InvoiceDataId");
+ b.Property("InvoiceDataId");
- b.HasKey("Address");
+ b.HasKey("Address");
- b.HasIndex("InvoiceDataId");
+ b.HasIndex("InvoiceDataId");
- b.ToTable("AddressInvoices");
- });
+ b.ToTable("AddressInvoices");
+ });
modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasMaxLength(50);
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasMaxLength(50);
- b.Property("StoreId")
- .HasMaxLength(50);
+ b.Property("StoreId")
+ .HasMaxLength(50);
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("StoreId");
+ b.HasIndex("StoreId");
- b.ToTable("ApiKeys");
- });
+ b.ToTable("ApiKeys");
+ });
modelBuilder.Entity("BTCPayServer.Data.AppData", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
- b.Property("AppType");
+ b.Property("AppType");
- b.Property("Created");
+ b.Property("Created");
- b.Property("Name");
+ b.Property("Name");
- b.Property("Settings");
+ b.Property("Settings");
- b.Property("StoreDataId");
+ b.Property("StoreDataId");
- b.Property("TagAllInvoices");
+ b.Property("TagAllInvoices");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("StoreDataId");
+ b.HasIndex("StoreDataId");
- b.ToTable("Apps");
- });
+ b.ToTable("Apps");
+ });
modelBuilder.Entity("BTCPayServer.Data.ApplicationUser", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
- b.Property("AccessFailedCount");
+ b.Property("AccessFailedCount");
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken();
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken();
- b.Property("Email")
- .HasMaxLength(256);
+ b.Property("Email")
+ .HasMaxLength(256);
- b.Property("EmailConfirmed");
+ b.Property("EmailConfirmed");
- b.Property("LockoutEnabled");
+ b.Property("LockoutEnabled");
- b.Property("LockoutEnd");
+ b.Property("LockoutEnd");
- b.Property("NormalizedEmail")
- .HasMaxLength(256);
+ b.Property("NormalizedEmail")
+ .HasMaxLength(256);
- b.Property("NormalizedUserName")
- .HasMaxLength(256);
+ b.Property("NormalizedUserName")
+ .HasMaxLength(256);
- b.Property("PasswordHash");
+ b.Property("PasswordHash");
- b.Property("PhoneNumber");
+ b.Property("PhoneNumber");
- b.Property("PhoneNumberConfirmed");
+ b.Property("PhoneNumberConfirmed");
- b.Property("RequiresEmailConfirmation");
+ b.Property("RequiresEmailConfirmation");
- b.Property("SecurityStamp");
+ b.Property("SecurityStamp");
- b.Property("TwoFactorEnabled");
+ b.Property("TwoFactorEnabled");
- b.Property("UserName")
- .HasMaxLength(256);
+ b.Property("UserName")
+ .HasMaxLength(256);
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("NormalizedEmail")
- .HasName("EmailIndex");
+ b.HasIndex("NormalizedEmail")
+ .HasName("EmailIndex");
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasName("UserNameIndex");
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasName("UserNameIndex");
- b.ToTable("AspNetUsers");
- });
+ b.ToTable("AspNetUsers");
+ });
modelBuilder.Entity("BTCPayServer.Data.BTCPayOpenIdAuthorization", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
- b.Property("ApplicationId");
+ b.Property("ApplicationId");
- b.Property("ConcurrencyToken")
- .IsConcurrencyToken()
- .HasMaxLength(50);
+ b.Property("ConcurrencyToken")
+ .IsConcurrencyToken()
+ .HasMaxLength(50);
- b.Property("Properties");
+ b.Property("Properties");
- b.Property("Scopes");
+ b.Property("Scopes");
- b.Property("Status")
- .IsRequired()
- .HasMaxLength(25);
+ b.Property("Status")
+ .IsRequired()
+ .HasMaxLength(25);
- b.Property("Subject")
- .IsRequired()
- .HasMaxLength(450);
+ b.Property("Subject")
+ .HasMaxLength(450);
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(25);
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(25);
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("ApplicationId", "Status", "Subject", "Type");
+ b.HasIndex("ApplicationId", "Status", "Subject", "Type");
- b.ToTable("OpenIddictAuthorizations");
- });
+ b.ToTable("OpenIddictAuthorizations");
+ });
modelBuilder.Entity("BTCPayServer.Data.BTCPayOpenIdClient", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
- b.Property("ApplicationUserId");
+ b.Property("ApplicationUserId");
- b.Property("ClientId")
- .IsRequired()
- .HasMaxLength(100);
+ b.Property("ClientId")
+ .IsRequired()
+ .HasMaxLength(100);
- b.Property("ClientSecret");
+ b.Property("ClientSecret");
- b.Property("ConcurrencyToken")
- .IsConcurrencyToken()
- .HasMaxLength(50);
+ b.Property("ConcurrencyToken")
+ .IsConcurrencyToken()
+ .HasMaxLength(50);
- b.Property("ConsentType");
+ b.Property("ConsentType");
- b.Property("DisplayName");
+ b.Property("DisplayName");
- b.Property("Permissions");
+ b.Property("Permissions");
- b.Property("PostLogoutRedirectUris");
+ b.Property("PostLogoutRedirectUris");
- b.Property("Properties");
+ b.Property("Properties");
- b.Property("RedirectUris");
+ b.Property("RedirectUris");
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(25);
+ b.Property("Requirements");
- b.HasKey("Id");
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(25);
- b.HasIndex("ApplicationUserId");
+ b.HasKey("Id");
- b.HasIndex("ClientId")
- .IsUnique();
+ b.HasIndex("ApplicationUserId");
- b.ToTable("OpenIddictApplications");
- });
+ b.HasIndex("ClientId")
+ .IsUnique();
+
+ b.ToTable("OpenIddictApplications");
+ });
modelBuilder.Entity("BTCPayServer.Data.BTCPayOpenIdToken", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
- b.Property("ApplicationId");
+ b.Property("ApplicationId");
- b.Property("AuthorizationId");
+ b.Property("AuthorizationId");
- b.Property("ConcurrencyToken")
- .IsConcurrencyToken()
- .HasMaxLength(50);
+ b.Property("ConcurrencyToken")
+ .IsConcurrencyToken()
+ .HasMaxLength(50);
- b.Property("CreationDate");
+ b.Property("CreationDate");
- b.Property("ExpirationDate");
+ b.Property("ExpirationDate");
- b.Property("Payload");
+ b.Property("Payload");
- b.Property("Properties");
+ b.Property("Properties");
- b.Property("ReferenceId")
- .HasMaxLength(100);
+ b.Property("ReferenceId")
+ .HasMaxLength(100);
- b.Property("Status")
- .IsRequired()
- .HasMaxLength(25);
+ b.Property("Status")
+ .IsRequired()
+ .HasMaxLength(25);
- b.Property("Subject")
- .IsRequired()
- .HasMaxLength(450);
+ b.Property("Subject")
+ .HasMaxLength(450);
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(25);
+ b.Property("Type")
+ .IsRequired()
+ .HasMaxLength(25);
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("AuthorizationId");
+ b.HasIndex("AuthorizationId");
- b.HasIndex("ReferenceId")
- .IsUnique();
+ b.HasIndex("ReferenceId")
+ .IsUnique();
- b.HasIndex("ApplicationId", "Status", "Subject", "Type");
+ b.HasIndex("ApplicationId", "Status", "Subject", "Type");
- b.ToTable("OpenIddictTokens");
- });
+ b.ToTable("OpenIddictTokens");
+ });
modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b =>
- {
- b.Property("InvoiceDataId");
+ {
+ b.Property("InvoiceDataId");
- b.Property("Address");
+ b.Property("Address");
- b.Property("Assigned");
+ b.Property("Assigned");
- b.Property("CryptoCode");
+ b.Property("CryptoCode");
- b.Property("UnAssigned");
+ b.Property("UnAssigned");
- b.HasKey("InvoiceDataId", "Address");
+ b.HasKey("InvoiceDataId", "Address");
- b.ToTable("HistoricalAddressInvoices");
- });
+ b.ToTable("HistoricalAddressInvoices");
+ });
modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
- b.Property("Blob");
+ b.Property("Blob");
- b.Property("Created");
+ b.Property("Created");
- b.Property("CustomerEmail");
+ b.Property("CustomerEmail");
- b.Property("ExceptionStatus");
+ b.Property("ExceptionStatus");
- b.Property("ItemCode");
+ b.Property("ItemCode");
- b.Property("OrderId");
+ b.Property("OrderId");
- b.Property("Status");
+ b.Property("Status");
- b.Property("StoreDataId");
+ b.Property("StoreDataId");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("StoreDataId");
+ b.HasIndex("StoreDataId");
- b.ToTable("Invoices");
- });
+ b.ToTable("Invoices");
+ });
modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b =>
- {
- b.Property("InvoiceDataId");
+ {
+ b.Property("InvoiceDataId");
- b.Property("UniqueId");
+ b.Property("UniqueId");
- b.Property("Message");
+ b.Property("Message");
- b.Property("Timestamp");
+ b.Property("Timestamp");
- b.HasKey("InvoiceDataId", "UniqueId");
+ b.HasKey("InvoiceDataId", "UniqueId");
- b.ToTable("InvoiceEvents");
- });
+ b.ToTable("InvoiceEvents");
+ });
modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
- b.Property("Label");
+ b.Property("Label");
- b.Property("PairingTime");
+ b.Property("PairingTime");
- b.Property("SIN");
+ b.Property("SIN");
- b.Property("StoreDataId");
+ b.Property("StoreDataId");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("SIN");
+ b.HasIndex("SIN");
- b.HasIndex("StoreDataId");
+ b.HasIndex("StoreDataId");
- b.ToTable("PairedSINData");
- });
+ b.ToTable("PairedSINData");
+ });
modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
- b.Property("DateCreated");
+ b.Property("DateCreated");
- b.Property("Expiration");
+ b.Property("Expiration");
- b.Property("Facade");
+ b.Property("Facade");
- b.Property("Label");
+ b.Property("Label");
- b.Property("SIN");
+ b.Property("SIN");
- b.Property("StoreDataId");
+ b.Property("StoreDataId");
- b.Property("TokenValue");
+ b.Property("TokenValue");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.ToTable("PairingCodes");
- });
+ b.ToTable("PairingCodes");
+ });
modelBuilder.Entity("BTCPayServer.Data.PaymentData", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
- b.Property("Accounted");
+ b.Property("Accounted");
- b.Property("Blob");
+ b.Property("Blob");
- b.Property("InvoiceDataId");
+ b.Property("InvoiceDataId");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("InvoiceDataId");
+ b.HasIndex("InvoiceDataId");
- b.ToTable("Payments");
- });
+ b.ToTable("Payments");
+ });
modelBuilder.Entity("BTCPayServer.Data.PaymentRequestData", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
- b.Property("Blob");
+ b.Property("Blob");
- b.Property("Created")
- .ValueGeneratedOnAdd()
- .HasDefaultValue(new DateTimeOffset(new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));
+ b.Property("Created")
+ .ValueGeneratedOnAdd()
+ .HasDefaultValue(new DateTimeOffset(new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));
- b.Property("Status");
+ b.Property("Status");
- b.Property("StoreDataId");
+ b.Property("StoreDataId");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("Status");
+ b.HasIndex("Status");
- b.HasIndex("StoreDataId");
+ b.HasIndex("StoreDataId");
- b.ToTable("PaymentRequests");
- });
+ b.ToTable("PaymentRequests");
+ });
modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b =>
- {
- b.Property("Id");
+ {
+ b.Property("Id");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.ToTable("PendingInvoices");
- });
+ b.ToTable("PendingInvoices");
+ });
modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
- b.Property("Blob");
+ b.Property("Blob");
- b.Property("InvoiceDataId");
+ b.Property("InvoiceDataId");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("InvoiceDataId");
+ b.HasIndex("InvoiceDataId");
- b.ToTable("RefundAddresses");
- });
+ b.ToTable("RefundAddresses");
+ });
modelBuilder.Entity("BTCPayServer.Data.SettingData", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
- b.Property("Value");
+ b.Property("Value");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.ToTable("Settings");
- });
+ b.ToTable("Settings");
+ });
modelBuilder.Entity("BTCPayServer.Data.StoreData", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
- b.Property("DefaultCrypto");
+ b.Property("DefaultCrypto");
- b.Property("DerivationStrategies");
+ b.Property("DerivationStrategies");
- b.Property("DerivationStrategy");
+ b.Property("DerivationStrategy");
- b.Property("SpeedPolicy");
+ b.Property("SpeedPolicy");
- b.Property("StoreBlob");
+ b.Property("StoreBlob");
- b.Property("StoreCertificate");
+ b.Property("StoreCertificate");
- b.Property("StoreName");
+ b.Property("StoreName");
- b.Property("StoreWebsite");
+ b.Property("StoreWebsite");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.ToTable("Stores");
- });
+ b.ToTable("Stores");
+ });
modelBuilder.Entity("BTCPayServer.Data.StoredFile", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
- b.Property("ApplicationUserId");
+ b.Property("ApplicationUserId");
- b.Property("FileName");
+ b.Property("FileName");
- b.Property("StorageFileName");
+ b.Property("StorageFileName");
- b.Property("Timestamp");
+ b.Property("Timestamp");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("ApplicationUserId");
+ b.HasIndex("ApplicationUserId");
- b.ToTable("Files");
- });
+ b.ToTable("Files");
+ });
modelBuilder.Entity("BTCPayServer.Data.U2FDevice", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
- b.Property("ApplicationUserId");
+ b.Property("ApplicationUserId");
- b.Property("AttestationCert")
- .IsRequired();
+ b.Property("AttestationCert")
+ .IsRequired();
- b.Property("Counter");
+ b.Property("Counter");
- b.Property