diff --git a/BTCPayServer.Data/Migrations/20170913143004_Init.Designer.cs b/BTCPayServer.Data/Migrations/20170913143004_Init.Designer.cs deleted file mode 100644 index 9f74a3158..000000000 --- a/BTCPayServer.Data/Migrations/20170913143004_Init.Designer.cs +++ /dev/null @@ -1,356 +0,0 @@ -// -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20170913143004_Init")] - partial class Init - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452"); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany() - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20170913143004_Init.cs b/BTCPayServer.Data/Migrations/20170913143004_Init.cs index 149900b1f..cb85dd7d4 100644 --- a/BTCPayServer.Data/Migrations/20170913143004_Init.cs +++ b/BTCPayServer.Data/Migrations/20170913143004_Init.cs @@ -1,9 +1,13 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20170913143004_Init")] public partial class Init : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20170926073744_Settings.Designer.cs b/BTCPayServer.Data/Migrations/20170926073744_Settings.Designer.cs deleted file mode 100644 index 396549776..000000000 --- a/BTCPayServer.Data/Migrations/20170926073744_Settings.Designer.cs +++ /dev/null @@ -1,368 +0,0 @@ -// -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20170926073744_Settings")] - partial class Settings - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452"); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany() - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20170926073744_Settings.cs b/BTCPayServer.Data/Migrations/20170926073744_Settings.cs index efca94c61..11d74400d 100644 --- a/BTCPayServer.Data/Migrations/20170926073744_Settings.cs +++ b/BTCPayServer.Data/Migrations/20170926073744_Settings.cs @@ -1,9 +1,13 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20170926073744_Settings")] public partial class Settings : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20170926084408_RequiresEmailConfirmation.Designer.cs b/BTCPayServer.Data/Migrations/20170926084408_RequiresEmailConfirmation.Designer.cs deleted file mode 100644 index 02ef5f18a..000000000 --- a/BTCPayServer.Data/Migrations/20170926084408_RequiresEmailConfirmation.Designer.cs +++ /dev/null @@ -1,370 +0,0 @@ -// -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20170926084408_RequiresEmailConfirmation")] - partial class RequiresEmailConfirmation - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452"); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany() - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20170926084408_RequiresEmailConfirmation.cs b/BTCPayServer.Data/Migrations/20170926084408_RequiresEmailConfirmation.cs index 48f2cfe23..c7964ee75 100644 --- a/BTCPayServer.Data/Migrations/20170926084408_RequiresEmailConfirmation.cs +++ b/BTCPayServer.Data/Migrations/20170926084408_RequiresEmailConfirmation.cs @@ -1,9 +1,13 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20170926084408_RequiresEmailConfirmation")] public partial class RequiresEmailConfirmation : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20171006013443_AddressMapping.Designer.cs b/BTCPayServer.Data/Migrations/20171006013443_AddressMapping.Designer.cs deleted file mode 100644 index 66dd8b298..000000000 --- a/BTCPayServer.Data/Migrations/20171006013443_AddressMapping.Designer.cs +++ /dev/null @@ -1,391 +0,0 @@ -// -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20171006013443_AddressMapping")] - partial class AddressMapping - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany() - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany() - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20171006013443_AddressMapping.cs b/BTCPayServer.Data/Migrations/20171006013443_AddressMapping.cs index 18a312349..dea0c8a37 100644 --- a/BTCPayServer.Data/Migrations/20171006013443_AddressMapping.cs +++ b/BTCPayServer.Data/Migrations/20171006013443_AddressMapping.cs @@ -1,9 +1,13 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20171006013443_AddressMapping")] public partial class AddressMapping : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20171010082424_Tokens.Designer.cs b/BTCPayServer.Data/Migrations/20171010082424_Tokens.Designer.cs deleted file mode 100644 index 65b771b5d..000000000 --- a/BTCPayServer.Data/Migrations/20171010082424_Tokens.Designer.cs +++ /dev/null @@ -1,443 +0,0 @@ -// -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20171010082424_Tokens")] - partial class Tokens - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("Name"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("Name"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany() - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany() - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20171010082424_Tokens.cs b/BTCPayServer.Data/Migrations/20171010082424_Tokens.cs index 9847f8a15..83910a2f9 100644 --- a/BTCPayServer.Data/Migrations/20171010082424_Tokens.cs +++ b/BTCPayServer.Data/Migrations/20171010082424_Tokens.cs @@ -1,9 +1,13 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20171010082424_Tokens")] public partial class Tokens : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20171012020112_PendingInvoices.Designer.cs b/BTCPayServer.Data/Migrations/20171012020112_PendingInvoices.Designer.cs deleted file mode 100644 index 3feb54bf8..000000000 --- a/BTCPayServer.Data/Migrations/20171012020112_PendingInvoices.Designer.cs +++ /dev/null @@ -1,449 +0,0 @@ -// -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20171012020112_PendingInvoices")] - partial class PendingInvoices - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany() - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany() - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20171012020112_PendingInvoices.cs b/BTCPayServer.Data/Migrations/20171012020112_PendingInvoices.cs index 1711c54e6..bc9780f98 100644 --- a/BTCPayServer.Data/Migrations/20171012020112_PendingInvoices.cs +++ b/BTCPayServer.Data/Migrations/20171012020112_PendingInvoices.cs @@ -1,9 +1,13 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20171012020112_PendingInvoices")] public partial class PendingInvoices : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20171023101754_StoreBlob.Designer.cs b/BTCPayServer.Data/Migrations/20171023101754_StoreBlob.Designer.cs deleted file mode 100644 index 445fafb29..000000000 --- a/BTCPayServer.Data/Migrations/20171023101754_StoreBlob.Designer.cs +++ /dev/null @@ -1,451 +0,0 @@ -// -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20171023101754_StoreBlob")] - partial class StoreBlob - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany() - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany() - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20171023101754_StoreBlob.cs b/BTCPayServer.Data/Migrations/20171023101754_StoreBlob.cs index 01a8299fe..a0b59c199 100644 --- a/BTCPayServer.Data/Migrations/20171023101754_StoreBlob.cs +++ b/BTCPayServer.Data/Migrations/20171023101754_StoreBlob.cs @@ -1,9 +1,13 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20171023101754_StoreBlob")] public partial class StoreBlob : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20171024163354_RenewUsedAddresses.Designer.cs b/BTCPayServer.Data/Migrations/20171024163354_RenewUsedAddresses.Designer.cs deleted file mode 100644 index 3574e9ba2..000000000 --- a/BTCPayServer.Data/Migrations/20171024163354_RenewUsedAddresses.Designer.cs +++ /dev/null @@ -1,476 +0,0 @@ -// -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20171024163354_RenewUsedAddresses")] - partial class RenewUsedAddresses - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("CreatedTime"); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.Property("InvoiceDataId"); - - b.Property("Address"); - - b.Property("Assigned"); - - b.Property("UnAssigned"); - - b.HasKey("InvoiceDataId", "Address"); - - b.ToTable("HistoricalAddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany() - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData") - .WithMany("HistoricalAddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany() - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20171024163354_RenewUsedAddresses.cs b/BTCPayServer.Data/Migrations/20171024163354_RenewUsedAddresses.cs index 83b785dc4..c3628c86c 100644 --- a/BTCPayServer.Data/Migrations/20171024163354_RenewUsedAddresses.cs +++ b/BTCPayServer.Data/Migrations/20171024163354_RenewUsedAddresses.cs @@ -1,9 +1,13 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20171024163354_RenewUsedAddresses")] public partial class RenewUsedAddresses : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20171105235734_PaymentAccounted.Designer.cs b/BTCPayServer.Data/Migrations/20171105235734_PaymentAccounted.Designer.cs deleted file mode 100644 index 1e054f257..000000000 --- a/BTCPayServer.Data/Migrations/20171105235734_PaymentAccounted.Designer.cs +++ /dev/null @@ -1,478 +0,0 @@ -// -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20171105235734_PaymentAccounted")] - partial class PaymentAccounted - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("CreatedTime"); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.Property("InvoiceDataId"); - - b.Property("Address"); - - b.Property("Assigned"); - - b.Property("UnAssigned"); - - b.HasKey("InvoiceDataId", "Address"); - - b.ToTable("HistoricalAddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Accounted"); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany() - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData") - .WithMany("HistoricalAddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany() - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20171105235734_PaymentAccounted.cs b/BTCPayServer.Data/Migrations/20171105235734_PaymentAccounted.cs index 49d2c1e15..b300a7303 100644 --- a/BTCPayServer.Data/Migrations/20171105235734_PaymentAccounted.cs +++ b/BTCPayServer.Data/Migrations/20171105235734_PaymentAccounted.cs @@ -1,9 +1,13 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20171105235734_PaymentAccounted")] public partial class PaymentAccounted : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20171221054550_AltcoinSupport.Designer.cs b/BTCPayServer.Data/Migrations/20171221054550_AltcoinSupport.Designer.cs deleted file mode 100644 index aae1ae57c..000000000 --- a/BTCPayServer.Data/Migrations/20171221054550_AltcoinSupport.Designer.cs +++ /dev/null @@ -1,480 +0,0 @@ -// -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20171221054550_AltcoinSupport")] - partial class AltcoinSupport - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("CreatedTime"); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.Property("InvoiceDataId"); - - b.Property("Address"); - - b.Property("Assigned"); - - b.Property("CryptoCode"); - - b.Property("UnAssigned"); - - b.HasKey("InvoiceDataId", "Address"); - - b.ToTable("HistoricalAddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Accounted"); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("AddressInvoices") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData") - .WithMany("HistoricalAddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany() - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20171221054550_AltcoinSupport.cs b/BTCPayServer.Data/Migrations/20171221054550_AltcoinSupport.cs index 46e56da6c..5b0e73960 100644 --- a/BTCPayServer.Data/Migrations/20171221054550_AltcoinSupport.cs +++ b/BTCPayServer.Data/Migrations/20171221054550_AltcoinSupport.cs @@ -1,9 +1,13 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20171221054550_AltcoinSupport")] public partial class AltcoinSupport : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20180106095215_DerivationStrategies.Designer.cs b/BTCPayServer.Data/Migrations/20180106095215_DerivationStrategies.Designer.cs deleted file mode 100644 index 80f54c702..000000000 --- a/BTCPayServer.Data/Migrations/20180106095215_DerivationStrategies.Designer.cs +++ /dev/null @@ -1,482 +0,0 @@ -// -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20180106095215_DerivationStrategies")] - partial class DerivationStrategies - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("CreatedTime"); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.Property("InvoiceDataId"); - - b.Property("Address"); - - b.Property("Assigned"); - - b.Property("CryptoCode"); - - b.Property("UnAssigned"); - - b.HasKey("InvoiceDataId", "Address"); - - b.ToTable("HistoricalAddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Accounted"); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DerivationStrategies"); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("AddressInvoices") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData") - .WithMany("HistoricalAddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany() - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20180106095215_DerivationStrategies.cs b/BTCPayServer.Data/Migrations/20180106095215_DerivationStrategies.cs index e2d22edc3..8b2d278fb 100644 --- a/BTCPayServer.Data/Migrations/20180106095215_DerivationStrategies.cs +++ b/BTCPayServer.Data/Migrations/20180106095215_DerivationStrategies.cs @@ -1,9 +1,13 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20180106095215_DerivationStrategies")] public partial class DerivationStrategies : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20180109021122_defaultcrypto.Designer.cs b/BTCPayServer.Data/Migrations/20180109021122_defaultcrypto.Designer.cs deleted file mode 100644 index 266e04b41..000000000 --- a/BTCPayServer.Data/Migrations/20180109021122_defaultcrypto.Designer.cs +++ /dev/null @@ -1,484 +0,0 @@ -// -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20180109021122_defaultcrypto")] - partial class defaultcrypto - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("CreatedTime"); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.Property("InvoiceDataId"); - - b.Property("Address"); - - b.Property("Assigned"); - - b.Property("CryptoCode"); - - b.Property("UnAssigned"); - - b.HasKey("InvoiceDataId", "Address"); - - b.ToTable("HistoricalAddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Accounted"); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DefaultCrypto"); - - b.Property("DerivationStrategies"); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("AddressInvoices") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData") - .WithMany("HistoricalAddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany() - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20180109021122_defaultcrypto.cs b/BTCPayServer.Data/Migrations/20180109021122_defaultcrypto.cs index 7bf4da66f..40900d93b 100644 --- a/BTCPayServer.Data/Migrations/20180109021122_defaultcrypto.cs +++ b/BTCPayServer.Data/Migrations/20180109021122_defaultcrypto.cs @@ -1,9 +1,13 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20180109021122_defaultcrypto")] public partial class defaultcrypto : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20180114123253_events.Designer.cs b/BTCPayServer.Data/Migrations/20180114123253_events.Designer.cs deleted file mode 100644 index 3b0eb26a3..000000000 --- a/BTCPayServer.Data/Migrations/20180114123253_events.Designer.cs +++ /dev/null @@ -1,507 +0,0 @@ -// -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20180114123253_events")] - partial class events - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("CreatedTime"); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.Property("InvoiceDataId"); - - b.Property("Address"); - - b.Property("Assigned"); - - b.Property("CryptoCode"); - - b.Property("UnAssigned"); - - b.HasKey("InvoiceDataId", "Address"); - - b.ToTable("HistoricalAddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.Property("InvoiceDataId"); - - b.Property("UniqueId"); - - b.Property("Message"); - - b.Property("Timestamp"); - - b.HasKey("InvoiceDataId", "UniqueId"); - - b.ToTable("InvoiceEvents"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Accounted"); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DefaultCrypto"); - - b.Property("DerivationStrategies"); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("AddressInvoices") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData") - .WithMany("HistoricalAddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany() - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData") - .WithMany("Events") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20180114123253_events.cs b/BTCPayServer.Data/Migrations/20180114123253_events.cs index 10d39acd0..447dcd817 100644 --- a/BTCPayServer.Data/Migrations/20180114123253_events.cs +++ b/BTCPayServer.Data/Migrations/20180114123253_events.cs @@ -1,9 +1,13 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20180114123253_events")] public partial class events : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20180402095640_appdata.Designer.cs b/BTCPayServer.Data/Migrations/20180402095640_appdata.Designer.cs deleted file mode 100644 index 486173f63..000000000 --- a/BTCPayServer.Data/Migrations/20180402095640_appdata.Designer.cs +++ /dev/null @@ -1,536 +0,0 @@ -// -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20180402095640_appdata")] - partial class appdata - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("CreatedTime"); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AppType"); - - b.Property("Created"); - - b.Property("Name"); - - b.Property("Settings"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Apps"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.Property("InvoiceDataId"); - - b.Property("Address"); - - b.Property("Assigned"); - - b.Property("CryptoCode"); - - b.Property("UnAssigned"); - - b.HasKey("InvoiceDataId", "Address"); - - b.ToTable("HistoricalAddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.Property("InvoiceDataId"); - - b.Property("UniqueId"); - - b.Property("Message"); - - b.Property("Timestamp"); - - b.HasKey("InvoiceDataId", "UniqueId"); - - b.ToTable("InvoiceEvents"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Accounted"); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DefaultCrypto"); - - b.Property("DerivationStrategies"); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("AddressInvoices") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Apps") - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData") - .WithMany("HistoricalAddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany() - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData") - .WithMany("Events") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20180402095640_appdata.cs b/BTCPayServer.Data/Migrations/20180402095640_appdata.cs index fade33986..c6af520d1 100644 --- a/BTCPayServer.Data/Migrations/20180402095640_appdata.cs +++ b/BTCPayServer.Data/Migrations/20180402095640_appdata.cs @@ -1,9 +1,13 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20180402095640_appdata")] public partial class appdata : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20180429083930_legacyapikey.Designer.cs b/BTCPayServer.Data/Migrations/20180429083930_legacyapikey.Designer.cs deleted file mode 100644 index 46d32b358..000000000 --- a/BTCPayServer.Data/Migrations/20180429083930_legacyapikey.Designer.cs +++ /dev/null @@ -1,552 +0,0 @@ -// -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.EntityFrameworkCore.Storage.Internal; -using System; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20180429083930_legacyapikey")] - partial class legacyapikey - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.0.2-rtm-10011"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("CreatedTime"); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasMaxLength(50); - - b.Property("StoreId") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("StoreId"); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AppType"); - - b.Property("Created"); - - b.Property("Name"); - - b.Property("Settings"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Apps"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.Property("InvoiceDataId"); - - b.Property("Address"); - - b.Property("Assigned"); - - b.Property("CryptoCode"); - - b.Property("UnAssigned"); - - b.HasKey("InvoiceDataId", "Address"); - - b.ToTable("HistoricalAddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.Property("InvoiceDataId"); - - b.Property("UniqueId"); - - b.Property("Message"); - - b.Property("Timestamp"); - - b.HasKey("InvoiceDataId", "UniqueId"); - - b.ToTable("InvoiceEvents"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Accounted"); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DefaultCrypto"); - - b.Property("DerivationStrategies"); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("AddressInvoices") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Apps") - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData") - .WithMany("HistoricalAddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany() - .HasForeignKey("StoreDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData") - .WithMany("Events") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20180429083930_legacyapikey.cs b/BTCPayServer.Data/Migrations/20180429083930_legacyapikey.cs index 0a1d21bb5..024cd60b3 100644 --- a/BTCPayServer.Data/Migrations/20180429083930_legacyapikey.cs +++ b/BTCPayServer.Data/Migrations/20180429083930_legacyapikey.cs @@ -1,9 +1,13 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20180429083930_legacyapikey")] public partial class legacyapikey : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20180719095626_CanDeleteStores.Designer.cs b/BTCPayServer.Data/Migrations/20180719095626_CanDeleteStores.Designer.cs deleted file mode 100644 index d1bbcf7de..000000000 --- a/BTCPayServer.Data/Migrations/20180719095626_CanDeleteStores.Designer.cs +++ /dev/null @@ -1,578 +0,0 @@ -// -using System; -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20180719095626_CanDeleteStores")] - partial class CanDeleteStores - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.1.0-rtm-30799"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("CreatedTime"); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasMaxLength(50); - - b.Property("StoreId") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("StoreId"); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AppType"); - - b.Property("Created"); - - b.Property("Name"); - - b.Property("Settings"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Apps"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.Property("InvoiceDataId"); - - b.Property("Address"); - - b.Property("Assigned"); - - b.Property("CryptoCode"); - - b.Property("UnAssigned"); - - b.HasKey("InvoiceDataId", "Address"); - - b.ToTable("HistoricalAddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.Property("InvoiceDataId"); - - b.Property("UniqueId"); - - b.Property("Message"); - - b.Property("Timestamp"); - - b.HasKey("InvoiceDataId", "UniqueId"); - - b.ToTable("InvoiceEvents"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Accounted"); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id"); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DefaultCrypto"); - - b.Property("DerivationStrategies"); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("AddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("APIKeys") - .HasForeignKey("StoreId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Apps") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("HistoricalAddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Invoices") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Events") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("PairedSINs") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("PendingInvoices") - .HasForeignKey("Id") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20180719095626_CanDeleteStores.cs b/BTCPayServer.Data/Migrations/20180719095626_CanDeleteStores.cs index f4dd95eff..bfa60ba83 100644 --- a/BTCPayServer.Data/Migrations/20180719095626_CanDeleteStores.cs +++ b/BTCPayServer.Data/Migrations/20180719095626_CanDeleteStores.cs @@ -1,7 +1,11 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20180719095626_CanDeleteStores")] public partial class CanDeleteStores : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20190121133309_AddPaymentRequests.Designer.cs b/BTCPayServer.Data/Migrations/20190121133309_AddPaymentRequests.Designer.cs deleted file mode 100644 index 5c72ba3a9..000000000 --- a/BTCPayServer.Data/Migrations/20190121133309_AddPaymentRequests.Designer.cs +++ /dev/null @@ -1,606 +0,0 @@ -// -using System; -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20190121133309_AddPaymentRequests")] - partial class AddPaymentRequests - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.1.4-rtm-31024"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("CreatedTime"); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasMaxLength(50); - - b.Property("StoreId") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("StoreId"); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AppType"); - - b.Property("Created"); - - b.Property("Name"); - - b.Property("Settings"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Apps"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.Property("InvoiceDataId"); - - b.Property("Address"); - - b.Property("Assigned"); - - b.Property("CryptoCode"); - - b.Property("UnAssigned"); - - b.HasKey("InvoiceDataId", "Address"); - - b.ToTable("HistoricalAddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.Property("InvoiceDataId"); - - b.Property("UniqueId"); - - b.Property("Message"); - - b.Property("Timestamp"); - - b.HasKey("InvoiceDataId", "UniqueId"); - - b.ToTable("InvoiceEvents"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Accounted"); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id"); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DefaultCrypto"); - - b.Property("DerivationStrategies"); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("BTCPayServer.Services.PaymentRequests.PaymentRequestData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PaymentRequests"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("AddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("APIKeys") - .HasForeignKey("StoreId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Apps") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("HistoricalAddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Invoices") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Events") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("PairedSINs") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("PendingInvoices") - .HasForeignKey("Id") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Services.PaymentRequests.PaymentRequestData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("PaymentRequests") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20190121133309_AddPaymentRequests.cs b/BTCPayServer.Data/Migrations/20190121133309_AddPaymentRequests.cs index 5c3ec7e84..c021fb361 100644 --- a/BTCPayServer.Data/Migrations/20190121133309_AddPaymentRequests.cs +++ b/BTCPayServer.Data/Migrations/20190121133309_AddPaymentRequests.cs @@ -1,8 +1,12 @@ using System; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20190121133309_AddPaymentRequests")] public partial class AddPaymentRequests : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20190219032533_AppsTagging.Designer.cs b/BTCPayServer.Data/Migrations/20190219032533_AppsTagging.Designer.cs deleted file mode 100644 index 940d2bfe4..000000000 --- a/BTCPayServer.Data/Migrations/20190219032533_AppsTagging.Designer.cs +++ /dev/null @@ -1,580 +0,0 @@ -// -using System; -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20190219032533_AppsTagging")] - partial class AppsTagging - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.1.8-servicing-32085"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("CreatedTime"); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasMaxLength(50); - - b.Property("StoreId") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("StoreId"); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AppType"); - - b.Property("Created"); - - b.Property("Name"); - - b.Property("Settings"); - - b.Property("StoreDataId"); - - b.Property("TagAllInvoices"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Apps"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.Property("InvoiceDataId"); - - b.Property("Address"); - - b.Property("Assigned"); - - b.Property("CryptoCode"); - - b.Property("UnAssigned"); - - b.HasKey("InvoiceDataId", "Address"); - - b.ToTable("HistoricalAddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.Property("InvoiceDataId"); - - b.Property("UniqueId"); - - b.Property("Message"); - - b.Property("Timestamp"); - - b.HasKey("InvoiceDataId", "UniqueId"); - - b.ToTable("InvoiceEvents"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Accounted"); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id"); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DefaultCrypto"); - - b.Property("DerivationStrategies"); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("AddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("APIKeys") - .HasForeignKey("StoreId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Apps") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("HistoricalAddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Invoices") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Events") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("PairedSINs") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("PendingInvoices") - .HasForeignKey("Id") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20190219032533_AppsTagging.cs b/BTCPayServer.Data/Migrations/20190219032533_AppsTagging.cs index fcbc47f14..2fb837af4 100644 --- a/BTCPayServer.Data/Migrations/20190219032533_AppsTagging.cs +++ b/BTCPayServer.Data/Migrations/20190219032533_AppsTagging.cs @@ -1,7 +1,11 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20190219032533_AppsTagging")] public partial class AppsTagging : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20190225091644_AddOpenIddict.Designer.cs b/BTCPayServer.Data/Migrations/20190225091644_AddOpenIddict.Designer.cs deleted file mode 100644 index abc0aa76c..000000000 --- a/BTCPayServer.Data/Migrations/20190225091644_AddOpenIddict.Designer.cs +++ /dev/null @@ -1,787 +0,0 @@ -// -using System; -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20190225091644_AddOpenIddict")] - partial class AddOpenIddict - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.1.4-rtm-31024"); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdAuthorization", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationId"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50); - - b.Property("Properties"); - - b.Property("Scopes"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(25); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(450); - - b.Property("Type") - .IsRequired() - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApplicationId", "Status", "Subject", "Type"); - - b.ToTable("OpenIddictAuthorizations"); - }); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdClient", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationUserId"); - - b.Property("ClientId") - .IsRequired() - .HasMaxLength(100); - - b.Property("ClientSecret"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50); - - b.Property("ConsentType"); - - b.Property("DisplayName"); - - b.Property("Permissions"); - - b.Property("PostLogoutRedirectUris"); - - b.Property("Properties"); - - b.Property("RedirectUris"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("ClientId") - .IsUnique(); - - b.ToTable("OpenIddictApplications"); - }); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationId"); - - b.Property("AuthorizationId"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50); - - b.Property("CreationDate"); - - b.Property("ExpirationDate"); - - b.Property("Payload"); - - b.Property("Properties"); - - b.Property("ReferenceId") - .HasMaxLength(100); - - b.Property("Status") - .IsRequired() - .HasMaxLength(25); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(450); - - b.Property("Type") - .IsRequired() - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("AuthorizationId"); - - b.HasIndex("ReferenceId") - .IsUnique(); - - b.HasIndex("ApplicationId", "Status", "Subject", "Type"); - - b.ToTable("OpenIddictTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("CreatedTime"); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasMaxLength(50); - - b.Property("StoreId") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("StoreId"); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AppType"); - - b.Property("Created"); - - b.Property("Name"); - - b.Property("Settings"); - - b.Property("StoreDataId"); - - b.Property("TagAllInvoices"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Apps"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.Property("InvoiceDataId"); - - b.Property("Address"); - - b.Property("Assigned"); - - b.Property("CryptoCode"); - - b.Property("UnAssigned"); - - b.HasKey("InvoiceDataId", "Address"); - - b.ToTable("HistoricalAddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.Property("InvoiceDataId"); - - b.Property("UniqueId"); - - b.Property("Message"); - - b.Property("Timestamp"); - - b.HasKey("InvoiceDataId", "UniqueId"); - - b.ToTable("InvoiceEvents"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Accounted"); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id"); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DefaultCrypto"); - - b.Property("DerivationStrategies"); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("BTCPayServer.Services.PaymentRequests.PaymentRequestData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PaymentRequests"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictScope", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50); - - b.Property("Description"); - - b.Property("DisplayName"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.Property("Properties"); - - b.Property("Resources"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("OpenIddictScopes"); - }); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdAuthorization", b => - { - b.HasOne("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdClient", "Application") - .WithMany("Authorizations") - .HasForeignKey("ApplicationId"); - }); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdClient", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("OpenIdClients") - .HasForeignKey("ApplicationUserId"); - }); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdToken", b => - { - b.HasOne("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdClient", "Application") - .WithMany("Tokens") - .HasForeignKey("ApplicationId"); - - b.HasOne("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdAuthorization", "Authorization") - .WithMany("Tokens") - .HasForeignKey("AuthorizationId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("AddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("APIKeys") - .HasForeignKey("StoreId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Apps") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("HistoricalAddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Invoices") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Events") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("PairedSINs") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("PendingInvoices") - .HasForeignKey("Id") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Services.PaymentRequests.PaymentRequestData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("PaymentRequests") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20190225091644_AddOpenIddict.cs b/BTCPayServer.Data/Migrations/20190225091644_AddOpenIddict.cs index e2181ce56..326f3ca96 100644 --- a/BTCPayServer.Data/Migrations/20190225091644_AddOpenIddict.cs +++ b/BTCPayServer.Data/Migrations/20190225091644_AddOpenIddict.cs @@ -1,8 +1,12 @@ using System; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20190225091644_AddOpenIddict")] public partial class AddOpenIddict : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20190324141717_AddFiles.Designer.cs b/BTCPayServer.Data/Migrations/20190324141717_AddFiles.Designer.cs deleted file mode 100644 index a937db748..000000000 --- a/BTCPayServer.Data/Migrations/20190324141717_AddFiles.Designer.cs +++ /dev/null @@ -1,635 +0,0 @@ -// -using System; -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20190324141717_AddFiles")] - partial class AddFiles - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.1.8-servicing-32085"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("CreatedTime"); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasMaxLength(50); - - b.Property("StoreId") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("StoreId"); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AppType"); - - b.Property("Created"); - - b.Property("Name"); - - b.Property("Settings"); - - b.Property("StoreDataId"); - - b.Property("TagAllInvoices"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Apps"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.Property("InvoiceDataId"); - - b.Property("Address"); - - b.Property("Assigned"); - - b.Property("CryptoCode"); - - b.Property("UnAssigned"); - - b.HasKey("InvoiceDataId", "Address"); - - b.ToTable("HistoricalAddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.Property("InvoiceDataId"); - - b.Property("UniqueId"); - - b.Property("Message"); - - b.Property("Timestamp"); - - b.HasKey("InvoiceDataId", "UniqueId"); - - b.ToTable("InvoiceEvents"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Accounted"); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id"); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DefaultCrypto"); - - b.Property("DerivationStrategies"); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("BTCPayServer.Services.PaymentRequests.PaymentRequestData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PaymentRequests"); - }); - - modelBuilder.Entity("BTCPayServer.Storage.Models.StoredFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationUserId"); - - b.Property("FileName"); - - b.Property("StorageFileName"); - - b.Property("Timestamp"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.ToTable("Files"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("AddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("APIKeys") - .HasForeignKey("StoreId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Apps") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("HistoricalAddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Invoices") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Events") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("PairedSINs") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("PendingInvoices") - .HasForeignKey("Id") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Services.PaymentRequests.PaymentRequestData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("PaymentRequests") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Storage.Models.StoredFile", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("StoredFiles") - .HasForeignKey("ApplicationUserId"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20190324141717_AddFiles.cs b/BTCPayServer.Data/Migrations/20190324141717_AddFiles.cs index f7833ec6d..105d17eaa 100644 --- a/BTCPayServer.Data/Migrations/20190324141717_AddFiles.cs +++ b/BTCPayServer.Data/Migrations/20190324141717_AddFiles.cs @@ -1,8 +1,12 @@ using System; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20190324141717_AddFiles")] public partial class AddFiles : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20190425081749_AddU2fDevices.Designer.cs b/BTCPayServer.Data/Migrations/20190425081749_AddU2fDevices.Designer.cs deleted file mode 100644 index 07894522f..000000000 --- a/BTCPayServer.Data/Migrations/20190425081749_AddU2fDevices.Designer.cs +++ /dev/null @@ -1,667 +0,0 @@ -// -using System; -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20190425081749_AddU2fDevices")] - partial class AddU2fDevices - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.1.8-servicing-32085"); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("CreatedTime"); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasMaxLength(50); - - b.Property("StoreId") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("StoreId"); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AppType"); - - b.Property("Created"); - - b.Property("Name"); - - b.Property("Settings"); - - b.Property("StoreDataId"); - - b.Property("TagAllInvoices"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Apps"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.Property("InvoiceDataId"); - - b.Property("Address"); - - b.Property("Assigned"); - - b.Property("CryptoCode"); - - b.Property("UnAssigned"); - - b.HasKey("InvoiceDataId", "Address"); - - b.ToTable("HistoricalAddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.Property("InvoiceDataId"); - - b.Property("UniqueId"); - - b.Property("Message"); - - b.Property("Timestamp"); - - b.HasKey("InvoiceDataId", "UniqueId"); - - b.ToTable("InvoiceEvents"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Accounted"); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id"); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DefaultCrypto"); - - b.Property("DerivationStrategies"); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("BTCPayServer.Services.PaymentRequests.PaymentRequestData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PaymentRequests"); - }); - - modelBuilder.Entity("BTCPayServer.Services.U2F.Models.U2FDevice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationUserId"); - - b.Property("AttestationCert") - .IsRequired(); - - b.Property("Counter"); - - b.Property("KeyHandle") - .IsRequired(); - - b.Property("Name"); - - b.Property("PublicKey") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.ToTable("U2FDevices"); - }); - - modelBuilder.Entity("BTCPayServer.Storage.Models.StoredFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationUserId"); - - b.Property("FileName"); - - b.Property("StorageFileName"); - - b.Property("Timestamp"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.ToTable("Files"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("AddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("APIKeys") - .HasForeignKey("StoreId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Apps") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("HistoricalAddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Invoices") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Events") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("PairedSINs") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("PendingInvoices") - .HasForeignKey("Id") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Services.PaymentRequests.PaymentRequestData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("PaymentRequests") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Services.U2F.Models.U2FDevice", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("U2FDevices") - .HasForeignKey("ApplicationUserId"); - }); - - modelBuilder.Entity("BTCPayServer.Storage.Models.StoredFile", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("StoredFiles") - .HasForeignKey("ApplicationUserId"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20190425081749_AddU2fDevices.cs b/BTCPayServer.Data/Migrations/20190425081749_AddU2fDevices.cs index 7b90d6cca..56df61156 100644 --- a/BTCPayServer.Data/Migrations/20190425081749_AddU2fDevices.cs +++ b/BTCPayServer.Data/Migrations/20190425081749_AddU2fDevices.cs @@ -1,8 +1,12 @@ using System; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20190425081749_AddU2fDevices")] public partial class AddU2fDevices : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20190701082105_sort_paymentrequests.Designer.cs b/BTCPayServer.Data/Migrations/20190701082105_sort_paymentrequests.Designer.cs deleted file mode 100644 index 9e3d3c71c..000000000 --- a/BTCPayServer.Data/Migrations/20190701082105_sort_paymentrequests.Designer.cs +++ /dev/null @@ -1,850 +0,0 @@ -// -using System; -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20190701082105_sort_paymentrequests")] - partial class sort_paymentrequests - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.1.11-servicing-32099"); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdAuthorization", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationId"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50); - - b.Property("Properties"); - - b.Property("Scopes"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(25); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(450); - - b.Property("Type") - .IsRequired() - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApplicationId", "Status", "Subject", "Type"); - - b.ToTable("OpenIddictAuthorizations"); - }); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdClient", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationUserId"); - - b.Property("ClientId") - .IsRequired() - .HasMaxLength(100); - - b.Property("ClientSecret"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50); - - b.Property("ConsentType"); - - b.Property("DisplayName"); - - b.Property("Permissions"); - - b.Property("PostLogoutRedirectUris"); - - b.Property("Properties"); - - b.Property("RedirectUris"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("ClientId") - .IsUnique(); - - b.ToTable("OpenIddictApplications"); - }); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationId"); - - b.Property("AuthorizationId"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50); - - b.Property("CreationDate"); - - b.Property("ExpirationDate"); - - b.Property("Payload"); - - b.Property("Properties"); - - b.Property("ReferenceId") - .HasMaxLength(100); - - b.Property("Status") - .IsRequired() - .HasMaxLength(25); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(450); - - b.Property("Type") - .IsRequired() - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("AuthorizationId"); - - b.HasIndex("ReferenceId") - .IsUnique(); - - b.HasIndex("ApplicationId", "Status", "Subject", "Type"); - - b.ToTable("OpenIddictTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("CreatedTime"); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasMaxLength(50); - - b.Property("StoreId") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("StoreId"); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AppType"); - - b.Property("Created"); - - b.Property("Name"); - - b.Property("Settings"); - - b.Property("StoreDataId"); - - b.Property("TagAllInvoices"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Apps"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.Property("InvoiceDataId"); - - b.Property("Address"); - - b.Property("Assigned"); - - b.Property("CryptoCode"); - - b.Property("UnAssigned"); - - b.HasKey("InvoiceDataId", "Address"); - - b.ToTable("HistoricalAddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.Property("InvoiceDataId"); - - b.Property("UniqueId"); - - b.Property("Message"); - - b.Property("Timestamp"); - - b.HasKey("InvoiceDataId", "UniqueId"); - - b.ToTable("InvoiceEvents"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Accounted"); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id"); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DefaultCrypto"); - - b.Property("DerivationStrategies"); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("BTCPayServer.Services.PaymentRequests.PaymentRequestData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - 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("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PaymentRequests"); - }); - - modelBuilder.Entity("BTCPayServer.Services.U2F.Models.U2FDevice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationUserId"); - - b.Property("AttestationCert") - .IsRequired(); - - b.Property("Counter"); - - b.Property("KeyHandle") - .IsRequired(); - - b.Property("Name"); - - b.Property("PublicKey") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.ToTable("U2FDevices"); - }); - - modelBuilder.Entity("BTCPayServer.Storage.Models.StoredFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationUserId"); - - b.Property("FileName"); - - b.Property("StorageFileName"); - - b.Property("Timestamp"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.ToTable("Files"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictScope", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50); - - b.Property("Description"); - - b.Property("DisplayName"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.Property("Properties"); - - b.Property("Resources"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("OpenIddictScopes"); - }); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdAuthorization", b => - { - b.HasOne("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdClient", "Application") - .WithMany("Authorizations") - .HasForeignKey("ApplicationId"); - }); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdClient", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("OpenIdClients") - .HasForeignKey("ApplicationUserId"); - }); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdToken", b => - { - b.HasOne("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdClient", "Application") - .WithMany("Tokens") - .HasForeignKey("ApplicationId"); - - b.HasOne("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdAuthorization", "Authorization") - .WithMany("Tokens") - .HasForeignKey("AuthorizationId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("AddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("APIKeys") - .HasForeignKey("StoreId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Apps") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("HistoricalAddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Invoices") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Events") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("PairedSINs") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("PendingInvoices") - .HasForeignKey("Id") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Services.PaymentRequests.PaymentRequestData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("PaymentRequests") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Services.U2F.Models.U2FDevice", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("U2FDevices") - .HasForeignKey("ApplicationUserId"); - }); - - modelBuilder.Entity("BTCPayServer.Storage.Models.StoredFile", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("StoredFiles") - .HasForeignKey("ApplicationUserId"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20190701082105_sort_paymentrequests.cs b/BTCPayServer.Data/Migrations/20190701082105_sort_paymentrequests.cs index f6b4ad1fe..acc290dd4 100644 --- a/BTCPayServer.Data/Migrations/20190701082105_sort_paymentrequests.cs +++ b/BTCPayServer.Data/Migrations/20190701082105_sort_paymentrequests.cs @@ -1,8 +1,12 @@ using System; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20190701082105_sort_paymentrequests")] public partial class sort_paymentrequests : Migration { protected override void Up(MigrationBuilder migrationBuilder) diff --git a/BTCPayServer.Data/Migrations/20190802142637_WalletData.Designer.cs b/BTCPayServer.Data/Migrations/20190802142637_WalletData.Designer.cs deleted file mode 100644 index 0740a13b6..000000000 --- a/BTCPayServer.Data/Migrations/20190802142637_WalletData.Designer.cs +++ /dev/null @@ -1,885 +0,0 @@ -// -using System; -using BTCPayServer.Data; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace BTCPayServer.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - [Migration("20190802142637_WalletData")] - partial class WalletData - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.1.11-servicing-32099"); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdAuthorization", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationId"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50); - - b.Property("Properties"); - - b.Property("Scopes"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(25); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(450); - - b.Property("Type") - .IsRequired() - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApplicationId", "Status", "Subject", "Type"); - - b.ToTable("OpenIddictAuthorizations"); - }); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdClient", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationUserId"); - - b.Property("ClientId") - .IsRequired() - .HasMaxLength(100); - - b.Property("ClientSecret"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50); - - b.Property("ConsentType"); - - b.Property("DisplayName"); - - b.Property("Permissions"); - - b.Property("PostLogoutRedirectUris"); - - b.Property("Properties"); - - b.Property("RedirectUris"); - - b.Property("Type") - .IsRequired() - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.HasIndex("ClientId") - .IsUnique(); - - b.ToTable("OpenIddictApplications"); - }); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdToken", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationId"); - - b.Property("AuthorizationId"); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50); - - b.Property("CreationDate"); - - b.Property("ExpirationDate"); - - b.Property("Payload"); - - b.Property("Properties"); - - b.Property("ReferenceId") - .HasMaxLength(100); - - b.Property("Status") - .IsRequired() - .HasMaxLength(25); - - b.Property("Subject") - .IsRequired() - .HasMaxLength(450); - - b.Property("Type") - .IsRequired() - .HasMaxLength(25); - - b.HasKey("Id"); - - b.HasIndex("AuthorizationId"); - - b.HasIndex("ReferenceId") - .IsUnique(); - - b.HasIndex("ApplicationId", "Status", "Subject", "Type"); - - b.ToTable("OpenIddictTokens"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.Property("Address") - .ValueGeneratedOnAdd(); - - b.Property("CreatedTime"); - - b.Property("InvoiceDataId"); - - b.HasKey("Address"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("AddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasMaxLength(50); - - b.Property("StoreId") - .HasMaxLength(50); - - b.HasKey("Id"); - - b.HasIndex("StoreId"); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AppType"); - - b.Property("Created"); - - b.Property("Name"); - - b.Property("Settings"); - - b.Property("StoreDataId"); - - b.Property("TagAllInvoices"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Apps"); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.Property("InvoiceDataId"); - - b.Property("Address"); - - b.Property("Assigned"); - - b.Property("CryptoCode"); - - b.Property("UnAssigned"); - - b.HasKey("InvoiceDataId", "Address"); - - b.ToTable("HistoricalAddressInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("Created"); - - b.Property("CustomerEmail"); - - b.Property("ExceptionStatus"); - - b.Property("ItemCode"); - - b.Property("OrderId"); - - b.Property("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("StoreDataId"); - - b.ToTable("Invoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.Property("InvoiceDataId"); - - b.Property("UniqueId"); - - b.Property("Message"); - - b.Property("Timestamp"); - - b.HasKey("InvoiceDataId", "UniqueId"); - - b.ToTable("InvoiceEvents"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Label"); - - b.Property("PairingTime"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("SIN"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PairedSINData"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateCreated"); - - b.Property("Expiration"); - - b.Property("Facade"); - - b.Property("Label"); - - b.Property("SIN"); - - b.Property("StoreDataId"); - - b.Property("TokenValue"); - - b.HasKey("Id"); - - b.ToTable("PairingCodes"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Accounted"); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("Payments"); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.Property("Id"); - - b.HasKey("Id"); - - b.ToTable("PendingInvoices"); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.Property("InvoiceDataId"); - - b.HasKey("Id"); - - b.HasIndex("InvoiceDataId"); - - b.ToTable("RefundAddresses"); - }); - - modelBuilder.Entity("BTCPayServer.Data.SettingData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Value"); - - b.HasKey("Id"); - - b.ToTable("Settings"); - }); - - modelBuilder.Entity("BTCPayServer.Data.StoreData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DefaultCrypto"); - - b.Property("DerivationStrategies"); - - b.Property("DerivationStrategy"); - - b.Property("SpeedPolicy"); - - b.Property("StoreBlob"); - - b.Property("StoreCertificate"); - - b.Property("StoreName"); - - b.Property("StoreWebsite"); - - b.HasKey("Id"); - - b.ToTable("Stores"); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.Property("ApplicationUserId"); - - b.Property("StoreDataId"); - - b.Property("Role"); - - b.HasKey("ApplicationUserId", "StoreDataId"); - - b.HasIndex("StoreDataId"); - - b.ToTable("UserStore"); - }); - - modelBuilder.Entity("BTCPayServer.Data.WalletData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Blob"); - - b.HasKey("Id"); - - b.ToTable("Wallets"); - }); - - modelBuilder.Entity("BTCPayServer.Data.WalletTransactionData", b => - { - b.Property("WalletDataId"); - - b.Property("TransactionId"); - - b.Property("Blob"); - - b.Property("Labels"); - - b.HasKey("WalletDataId", "TransactionId"); - - b.ToTable("WalletTransactions"); - }); - - modelBuilder.Entity("BTCPayServer.Models.ApplicationUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("AccessFailedCount"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("RequiresEmailConfirmation"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("UserName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("BTCPayServer.Services.PaymentRequests.PaymentRequestData", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - 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("Status"); - - b.Property("StoreDataId"); - - b.HasKey("Id"); - - b.HasIndex("Status"); - - b.HasIndex("StoreDataId"); - - b.ToTable("PaymentRequests"); - }); - - modelBuilder.Entity("BTCPayServer.Services.U2F.Models.U2FDevice", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationUserId"); - - b.Property("AttestationCert") - .IsRequired(); - - b.Property("Counter"); - - b.Property("KeyHandle") - .IsRequired(); - - b.Property("Name"); - - b.Property("PublicKey") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.ToTable("U2FDevices"); - }); - - modelBuilder.Entity("BTCPayServer.Storage.Models.StoredFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ApplicationUserId"); - - b.Property("FileName"); - - b.Property("StorageFileName"); - - b.Property("Timestamp"); - - b.HasKey("Id"); - - b.HasIndex("ApplicationUserId"); - - b.ToTable("Files"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId") - .IsRequired(); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictScope", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyToken") - .IsConcurrencyToken() - .HasMaxLength(50); - - b.Property("Description"); - - b.Property("DisplayName"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(200); - - b.Property("Properties"); - - b.Property("Resources"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("OpenIddictScopes"); - }); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdAuthorization", b => - { - b.HasOne("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdClient", "Application") - .WithMany("Authorizations") - .HasForeignKey("ApplicationId"); - }); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdClient", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("OpenIdClients") - .HasForeignKey("ApplicationUserId"); - }); - - modelBuilder.Entity("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdToken", b => - { - b.HasOne("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdClient", "Application") - .WithMany("Tokens") - .HasForeignKey("ApplicationId"); - - b.HasOne("BTCPayServer.Authentication.OpenId.Models.BTCPayOpenIdAuthorization", "Authorization") - .WithMany("Tokens") - .HasForeignKey("AuthorizationId"); - }); - - modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("AddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("APIKeys") - .HasForeignKey("StoreId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.AppData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Apps") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("HistoricalAddressInvoices") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("Invoices") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Events") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("PairedSINs") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PaymentData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("Payments") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("PendingInvoices") - .HasForeignKey("Id") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b => - { - b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData") - .WithMany("RefundAddresses") - .HasForeignKey("InvoiceDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.UserStore", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("UserStores") - .HasForeignKey("ApplicationUserId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("UserStores") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Data.WalletTransactionData", b => - { - b.HasOne("BTCPayServer.Data.WalletData", "WalletData") - .WithMany("WalletTransactions") - .HasForeignKey("WalletDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Services.PaymentRequests.PaymentRequestData", b => - { - b.HasOne("BTCPayServer.Data.StoreData", "StoreData") - .WithMany("PaymentRequests") - .HasForeignKey("StoreDataId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("BTCPayServer.Services.U2F.Models.U2FDevice", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("U2FDevices") - .HasForeignKey("ApplicationUserId"); - }); - - modelBuilder.Entity("BTCPayServer.Storage.Models.StoredFile", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser", "ApplicationUser") - .WithMany("StoredFiles") - .HasForeignKey("ApplicationUserId"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("BTCPayServer.Models.ApplicationUser") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BTCPayServer.Data/Migrations/20190802142637_WalletData.cs b/BTCPayServer.Data/Migrations/20190802142637_WalletData.cs index 86b213240..fa600e54c 100644 --- a/BTCPayServer.Data/Migrations/20190802142637_WalletData.cs +++ b/BTCPayServer.Data/Migrations/20190802142637_WalletData.cs @@ -1,8 +1,12 @@ using System; +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; namespace BTCPayServer.Migrations { + [DbContext(typeof(ApplicationDbContext))] + [Migration("20190802142637_WalletData")] public partial class WalletData : Migration { protected override void Up(MigrationBuilder migrationBuilder)