Compare commits

...

1 Commits

Author SHA1 Message Date
aa295d121e Fix sqlite madness
* Need to reference Microsoft.EntityFrameworkCore.Design else you can't generate migrations
* fix design time migrations issues
* update snapshot
```
Your startup project 'BTCPayServer.Data' doesn't reference Microsoft.EntityFrameworkCore.Design. This package is required for the Entity Framework Core Tools to work. Ensure your startup project is c
orrect, install the package, and try again.
```
*
2020-01-19 13:49:11 +01:00
3 changed files with 366 additions and 202 deletions

View File

@ -3,6 +3,7 @@
<Import Project="../Build/Common.csproj" />
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.1.0" />

View File

@ -2,33 +2,33 @@
using System.Linq;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.EntityFrameworkCore.Infrastructure;
using OpenIddict.EntityFrameworkCore.Models;
namespace BTCPayServer.Data
{
public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<ApplicationDbContext>
{
public ApplicationDbContext CreateDbContext(string[] args)
{
var builder = new DbContextOptionsBuilder<ApplicationDbContext>();
builder.UseSqlite("Data Source=temp.db");
return new ApplicationDbContext(builder.Options, true);
}
}
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
//public ApplicationDbContext(): base(CreateMySql())
//{
private readonly bool _designTime;
//}
//private static DbContextOptions CreateMySql()
//{
// return new DbContextOptionsBuilder<ApplicationDbContext>()
// .UseMySql("Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;")
// .Options;
//}
public ApplicationDbContext()
{
}
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options, bool designTime = false)
: base(options)
{
_designTime = designTime;
}
public DbSet<InvoiceData> Invoices
@ -257,7 +257,7 @@ namespace BTCPayServer.Data
builder.UseOpenIddict<BTCPayOpenIdClient, BTCPayOpenIdAuthorization, OpenIddictScope<string>, BTCPayOpenIdToken, string>();
if (Database.ProviderName == "Microsoft.EntityFrameworkCore.Sqlite")
if (Database.IsSqlite() && !_designTime)
{
// SQLite does not have proper support for DateTimeOffset via Entity Framework Core, see the limitations
// here: https://docs.microsoft.com/en-us/ef/core/providers/sqlite/limitations#query-limitations

View File

@ -14,31 +14,16 @@ namespace BTCPayServer.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.1.14-servicing-32113");
modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b =>
{
b.Property<string>("Address")
.ValueGeneratedOnAdd();
b.Property<DateTimeOffset?>("CreatedTime");
b.Property<string>("InvoiceDataId");
b.HasKey("Address");
b.HasIndex("InvoiceDataId");
b.ToTable("AddressInvoices");
});
.HasAnnotation("ProductVersion", "3.1.1");
modelBuilder.Entity("BTCPayServer.Data.APIKeyData", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.HasMaxLength(50);
b.Property<string>("StoreId")
.HasColumnType("TEXT")
.HasMaxLength(50);
b.HasKey("Id");
@ -48,22 +33,46 @@ namespace BTCPayServer.Migrations
b.ToTable("ApiKeys");
});
modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b =>
{
b.Property<string>("Address")
.HasColumnType("TEXT");
b.Property<DateTimeOffset?>("CreatedTime")
.HasColumnType("TEXT");
b.Property<string>("InvoiceDataId")
.HasColumnType("TEXT");
b.HasKey("Address");
b.HasIndex("InvoiceDataId");
b.ToTable("AddressInvoices");
});
modelBuilder.Entity("BTCPayServer.Data.AppData", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.HasColumnType("TEXT");
b.Property<string>("AppType");
b.Property<string>("AppType")
.HasColumnType("TEXT");
b.Property<DateTimeOffset>("Created");
b.Property<DateTimeOffset>("Created")
.HasColumnType("TEXT");
b.Property<string>("Name");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Settings");
b.Property<string>("Settings")
.HasColumnType("TEXT");
b.Property<string>("StoreDataId");
b.Property<string>("StoreDataId")
.HasColumnType("TEXT");
b.Property<bool>("TagAllInvoices");
b.Property<bool>("TagAllInvoices")
.HasColumnType("INTEGER");
b.HasKey("Id");
@ -75,41 +84,56 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.ApplicationUser", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.HasColumnType("TEXT");
b.Property<int>("AccessFailedCount");
b.Property<int>("AccessFailedCount")
.HasColumnType("INTEGER");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasColumnType("TEXT")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed");
b.Property<bool>("EmailConfirmed")
.HasColumnType("INTEGER");
b.Property<bool>("LockoutEnabled");
b.Property<bool>("LockoutEnabled")
.HasColumnType("INTEGER");
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("TEXT");
b.Property<string>("NormalizedEmail")
.HasColumnType("TEXT")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.HasColumnType("TEXT")
.HasMaxLength(256);
b.Property<string>("PasswordHash");
b.Property<string>("PasswordHash")
.HasColumnType("TEXT");
b.Property<string>("PhoneNumber");
b.Property<string>("PhoneNumber")
.HasColumnType("TEXT");
b.Property<bool>("PhoneNumberConfirmed");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("INTEGER");
b.Property<bool>("RequiresEmailConfirmation");
b.Property<bool>("RequiresEmailConfirmation")
.HasColumnType("INTEGER");
b.Property<string>("SecurityStamp");
b.Property<string>("SecurityStamp")
.HasColumnType("TEXT");
b.Property<bool>("TwoFactorEnabled");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("INTEGER");
b.Property<string>("UserName")
.HasColumnType("TEXT")
.HasMaxLength(256);
b.HasKey("Id");
@ -127,27 +151,35 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.BTCPayOpenIdAuthorization", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ApplicationId");
b.Property<string>("ApplicationId")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasColumnType("TEXT")
.HasMaxLength(50);
b.Property<string>("Properties");
b.Property<string>("Properties")
.HasColumnType("TEXT");
b.Property<string>("Scopes");
b.Property<string>("Scopes")
.HasColumnType("TEXT");
b.Property<string>("Status")
.IsRequired()
.HasColumnType("TEXT")
.HasMaxLength(25);
b.Property<string>("Subject")
.HasColumnType("TEXT")
.HasMaxLength(450);
b.Property<string>("Type")
.IsRequired()
.HasColumnType("TEXT")
.HasMaxLength(25);
b.HasKey("Id");
@ -160,36 +192,49 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.BTCPayOpenIdClient", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ApplicationUserId");
b.Property<string>("ApplicationUserId")
.HasColumnType("TEXT");
b.Property<string>("ClientId")
.IsRequired()
.HasColumnType("TEXT")
.HasMaxLength(100);
b.Property<string>("ClientSecret");
b.Property<string>("ClientSecret")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasColumnType("TEXT")
.HasMaxLength(50);
b.Property<string>("ConsentType");
b.Property<string>("ConsentType")
.HasColumnType("TEXT");
b.Property<string>("DisplayName");
b.Property<string>("DisplayName")
.HasColumnType("TEXT");
b.Property<string>("Permissions");
b.Property<string>("Permissions")
.HasColumnType("TEXT");
b.Property<string>("PostLogoutRedirectUris");
b.Property<string>("PostLogoutRedirectUris")
.HasColumnType("TEXT");
b.Property<string>("Properties");
b.Property<string>("Properties")
.HasColumnType("TEXT");
b.Property<string>("RedirectUris");
b.Property<string>("RedirectUris")
.HasColumnType("TEXT");
b.Property<string>("Requirements");
b.Property<string>("Requirements")
.HasColumnType("TEXT");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("TEXT")
.HasMaxLength(25);
b.HasKey("Id");
@ -205,36 +250,48 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.BTCPayOpenIdToken", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ApplicationId");
b.Property<string>("ApplicationId")
.HasColumnType("TEXT");
b.Property<string>("AuthorizationId");
b.Property<string>("AuthorizationId")
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasColumnType("TEXT")
.HasMaxLength(50);
b.Property<DateTimeOffset?>("CreationDate");
b.Property<DateTimeOffset?>("CreationDate")
.HasColumnType("TEXT");
b.Property<DateTimeOffset?>("ExpirationDate");
b.Property<DateTimeOffset?>("ExpirationDate")
.HasColumnType("TEXT");
b.Property<string>("Payload");
b.Property<string>("Payload")
.HasColumnType("TEXT");
b.Property<string>("Properties");
b.Property<string>("Properties")
.HasColumnType("TEXT");
b.Property<string>("ReferenceId")
.HasColumnType("TEXT")
.HasMaxLength(100);
b.Property<string>("Status")
.IsRequired()
.HasColumnType("TEXT")
.HasMaxLength(25);
b.Property<string>("Subject")
.HasColumnType("TEXT")
.HasMaxLength(450);
b.Property<string>("Type")
.IsRequired()
.HasColumnType("TEXT")
.HasMaxLength(25);
b.HasKey("Id");
@ -251,15 +308,20 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.HistoricalAddressInvoiceData", b =>
{
b.Property<string>("InvoiceDataId");
b.Property<string>("InvoiceDataId")
.HasColumnType("TEXT");
b.Property<string>("Address");
b.Property<string>("Address")
.HasColumnType("TEXT");
b.Property<DateTimeOffset>("Assigned");
b.Property<DateTimeOffset>("Assigned")
.HasColumnType("TEXT");
b.Property<string>("CryptoCode");
b.Property<string>("CryptoCode")
.HasColumnType("TEXT");
b.Property<DateTimeOffset?>("UnAssigned");
b.Property<DateTimeOffset?>("UnAssigned")
.HasColumnType("TEXT");
b.HasKey("InvoiceDataId", "Address");
@ -269,23 +331,31 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.HasColumnType("TEXT");
b.Property<byte[]>("Blob");
b.Property<byte[]>("Blob")
.HasColumnType("BLOB");
b.Property<DateTimeOffset>("Created");
b.Property<DateTimeOffset>("Created")
.HasColumnType("TEXT");
b.Property<string>("CustomerEmail");
b.Property<string>("CustomerEmail")
.HasColumnType("TEXT");
b.Property<string>("ExceptionStatus");
b.Property<string>("ExceptionStatus")
.HasColumnType("TEXT");
b.Property<string>("ItemCode");
b.Property<string>("ItemCode")
.HasColumnType("TEXT");
b.Property<string>("OrderId");
b.Property<string>("OrderId")
.HasColumnType("TEXT");
b.Property<string>("Status");
b.Property<string>("Status")
.HasColumnType("TEXT");
b.Property<string>("StoreDataId");
b.Property<string>("StoreDataId")
.HasColumnType("TEXT");
b.HasKey("Id");
@ -296,13 +366,17 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.InvoiceEventData", b =>
{
b.Property<string>("InvoiceDataId");
b.Property<string>("InvoiceDataId")
.HasColumnType("TEXT");
b.Property<string>("UniqueId");
b.Property<string>("UniqueId")
.HasColumnType("TEXT");
b.Property<string>("Message");
b.Property<string>("Message")
.HasColumnType("TEXT");
b.Property<DateTimeOffset>("Timestamp");
b.Property<DateTimeOffset>("Timestamp")
.HasColumnType("TEXT");
b.HasKey("InvoiceDataId", "UniqueId");
@ -312,15 +386,19 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.HasColumnType("TEXT");
b.Property<string>("Label");
b.Property<string>("Label")
.HasColumnType("TEXT");
b.Property<DateTimeOffset>("PairingTime");
b.Property<DateTimeOffset>("PairingTime")
.HasColumnType("TEXT");
b.Property<string>("SIN");
b.Property<string>("SIN")
.HasColumnType("TEXT");
b.Property<string>("StoreDataId");
b.Property<string>("StoreDataId")
.HasColumnType("TEXT");
b.HasKey("Id");
@ -334,21 +412,28 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.PairingCodeData", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.HasColumnType("TEXT");
b.Property<DateTime>("DateCreated");
b.Property<DateTime>("DateCreated")
.HasColumnType("TEXT");
b.Property<DateTimeOffset>("Expiration");
b.Property<DateTimeOffset>("Expiration")
.HasColumnType("TEXT");
b.Property<string>("Facade");
b.Property<string>("Facade")
.HasColumnType("TEXT");
b.Property<string>("Label");
b.Property<string>("Label")
.HasColumnType("TEXT");
b.Property<string>("SIN");
b.Property<string>("SIN")
.HasColumnType("TEXT");
b.Property<string>("StoreDataId");
b.Property<string>("StoreDataId")
.HasColumnType("TEXT");
b.Property<string>("TokenValue");
b.Property<string>("TokenValue")
.HasColumnType("TEXT");
b.HasKey("Id");
@ -358,13 +443,16 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.PaymentData", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.HasColumnType("TEXT");
b.Property<bool>("Accounted");
b.Property<bool>("Accounted")
.HasColumnType("INTEGER");
b.Property<byte[]>("Blob");
b.Property<byte[]>("Blob")
.HasColumnType("BLOB");
b.Property<string>("InvoiceDataId");
b.Property<string>("InvoiceDataId")
.HasColumnType("TEXT");
b.HasKey("Id");
@ -376,17 +464,21 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.PaymentRequestData", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.HasColumnType("TEXT");
b.Property<byte[]>("Blob");
b.Property<byte[]>("Blob")
.HasColumnType("BLOB");
b.Property<DateTimeOffset>("Created")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.HasDefaultValue(new DateTimeOffset(new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));
b.Property<int>("Status");
b.Property<int>("Status")
.HasColumnType("INTEGER");
b.Property<string>("StoreDataId");
b.Property<string>("StoreDataId")
.HasColumnType("TEXT");
b.HasKey("Id");
@ -399,7 +491,8 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.PendingInvoiceData", b =>
{
b.Property<string>("Id");
b.Property<string>("Id")
.HasColumnType("TEXT");
b.HasKey("Id");
@ -409,11 +502,13 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.HasColumnType("TEXT");
b.Property<byte[]>("Blob");
b.Property<byte[]>("Blob")
.HasColumnType("BLOB");
b.Property<string>("InvoiceDataId");
b.Property<string>("InvoiceDataId")
.HasColumnType("TEXT");
b.HasKey("Id");
@ -425,9 +520,10 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.SettingData", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.HasColumnType("TEXT");
b.Property<string>("Value");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("Id");
@ -437,23 +533,31 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.StoreData", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.HasColumnType("TEXT");
b.Property<string>("DefaultCrypto");
b.Property<string>("DefaultCrypto")
.HasColumnType("TEXT");
b.Property<string>("DerivationStrategies");
b.Property<string>("DerivationStrategies")
.HasColumnType("TEXT");
b.Property<string>("DerivationStrategy");
b.Property<string>("DerivationStrategy")
.HasColumnType("TEXT");
b.Property<int>("SpeedPolicy");
b.Property<int>("SpeedPolicy")
.HasColumnType("INTEGER");
b.Property<byte[]>("StoreBlob");
b.Property<byte[]>("StoreBlob")
.HasColumnType("BLOB");
b.Property<byte[]>("StoreCertificate");
b.Property<byte[]>("StoreCertificate")
.HasColumnType("BLOB");
b.Property<string>("StoreName");
b.Property<string>("StoreName")
.HasColumnType("TEXT");
b.Property<string>("StoreWebsite");
b.Property<string>("StoreWebsite")
.HasColumnType("TEXT");
b.HasKey("Id");
@ -463,15 +567,20 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.StoredFile", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ApplicationUserId");
b.Property<string>("ApplicationUserId")
.HasColumnType("TEXT");
b.Property<string>("FileName");
b.Property<string>("FileName")
.HasColumnType("TEXT");
b.Property<string>("StorageFileName");
b.Property<string>("StorageFileName")
.HasColumnType("TEXT");
b.Property<DateTime>("Timestamp");
b.Property<DateTime>("Timestamp")
.HasColumnType("TEXT");
b.HasKey("Id");
@ -483,22 +592,28 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.U2FDevice", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.HasColumnType("TEXT");
b.Property<string>("ApplicationUserId");
b.Property<string>("ApplicationUserId")
.HasColumnType("TEXT");
b.Property<byte[]>("AttestationCert")
.IsRequired();
.IsRequired()
.HasColumnType("BLOB");
b.Property<int>("Counter");
b.Property<int>("Counter")
.HasColumnType("INTEGER");
b.Property<byte[]>("KeyHandle")
.IsRequired();
.IsRequired()
.HasColumnType("BLOB");
b.Property<string>("Name");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<byte[]>("PublicKey")
.IsRequired();
.IsRequired()
.HasColumnType("BLOB");
b.HasKey("Id");
@ -509,11 +624,14 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.UserStore", b =>
{
b.Property<string>("ApplicationUserId");
b.Property<string>("ApplicationUserId")
.HasColumnType("TEXT");
b.Property<string>("StoreDataId");
b.Property<string>("StoreDataId")
.HasColumnType("TEXT");
b.Property<string>("Role");
b.Property<string>("Role")
.HasColumnType("TEXT");
b.HasKey("ApplicationUserId", "StoreDataId");
@ -525,9 +643,10 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.WalletData", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.HasColumnType("TEXT");
b.Property<byte[]>("Blob");
b.Property<byte[]>("Blob")
.HasColumnType("BLOB");
b.HasKey("Id");
@ -536,13 +655,17 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.WalletTransactionData", b =>
{
b.Property<string>("WalletDataId");
b.Property<string>("WalletDataId")
.HasColumnType("TEXT");
b.Property<string>("TransactionId");
b.Property<string>("TransactionId")
.HasColumnType("TEXT");
b.Property<byte[]>("Blob");
b.Property<byte[]>("Blob")
.HasColumnType("BLOB");
b.Property<string>("Labels");
b.Property<string>("Labels")
.HasColumnType("TEXT");
b.HasKey("WalletDataId", "TransactionId");
@ -552,15 +675,18 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Name")
.HasColumnType("TEXT")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasColumnType("TEXT")
.HasMaxLength(256);
b.HasKey("Id");
@ -575,14 +701,18 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<string>("RoleId")
.IsRequired();
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
@ -594,14 +724,18 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ClaimType");
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
b.Property<string>("ClaimValue");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
b.Property<string>("UserId")
.IsRequired();
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
@ -612,14 +746,18 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider");
b.Property<string>("LoginProvider")
.HasColumnType("TEXT");
b.Property<string>("ProviderKey");
b.Property<string>("ProviderKey")
.HasColumnType("TEXT");
b.Property<string>("ProviderDisplayName");
b.Property<string>("ProviderDisplayName")
.HasColumnType("TEXT");
b.Property<string>("UserId")
.IsRequired();
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("LoginProvider", "ProviderKey");
@ -630,9 +768,11 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId");
b.Property<string>("UserId")
.HasColumnType("TEXT");
b.Property<string>("RoleId");
b.Property<string>("RoleId")
.HasColumnType("TEXT");
b.HasKey("UserId", "RoleId");
@ -643,13 +783,17 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId");
b.Property<string>("UserId")
.HasColumnType("TEXT");
b.Property<string>("LoginProvider");
b.Property<string>("LoginProvider")
.HasColumnType("TEXT");
b.Property<string>("Name");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<string>("Value");
b.Property<string>("Value")
.HasColumnType("TEXT");
b.HasKey("UserId", "LoginProvider", "Name");
@ -659,23 +803,30 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("OpenIddict.EntityFrameworkCore.Models.OpenIddictScope<string>", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("ConcurrencyToken")
.IsConcurrencyToken()
.HasColumnType("TEXT")
.HasMaxLength(50);
b.Property<string>("Description");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DisplayName");
b.Property<string>("DisplayName")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT")
.HasMaxLength(200);
b.Property<string>("Properties");
b.Property<string>("Properties")
.HasColumnType("TEXT");
b.Property<string>("Resources");
b.Property<string>("Resources")
.HasColumnType("TEXT");
b.HasKey("Id");
@ -685,14 +836,6 @@ namespace BTCPayServer.Migrations
b.ToTable("OpenIddictScopes");
});
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")
@ -701,6 +844,14 @@ namespace BTCPayServer.Migrations
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("BTCPayServer.Data.AddressInvoiceData", b =>
{
b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData")
.WithMany("AddressInvoices")
.HasForeignKey("InvoiceDataId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("BTCPayServer.Data.AppData", b =>
{
b.HasOne("BTCPayServer.Data.StoreData", "StoreData")
@ -739,7 +890,8 @@ namespace BTCPayServer.Migrations
b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData")
.WithMany("HistoricalAddressInvoices")
.HasForeignKey("InvoiceDataId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("BTCPayServer.Data.InvoiceData", b =>
@ -755,7 +907,8 @@ namespace BTCPayServer.Migrations
b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData")
.WithMany("Events")
.HasForeignKey("InvoiceDataId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("BTCPayServer.Data.PairedSINData", b =>
@ -787,7 +940,8 @@ namespace BTCPayServer.Migrations
b.HasOne("BTCPayServer.Data.InvoiceData", "InvoiceData")
.WithMany("PendingInvoices")
.HasForeignKey("Id")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("BTCPayServer.Data.RefundAddressesData", b =>
@ -817,12 +971,14 @@ namespace BTCPayServer.Migrations
b.HasOne("BTCPayServer.Data.ApplicationUser", "ApplicationUser")
.WithMany("UserStores")
.HasForeignKey("ApplicationUserId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BTCPayServer.Data.StoreData", "StoreData")
.WithMany("UserStores")
.HasForeignKey("StoreDataId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("BTCPayServer.Data.WalletTransactionData", b =>
@ -830,52 +986,59 @@ namespace BTCPayServer.Migrations
b.HasOne("BTCPayServer.Data.WalletData", "WalletData")
.WithMany("WalletTransactions")
.HasForeignKey("WalletDataId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{
b.HasOne("BTCPayServer.Data.ApplicationUser")
b.HasOne("BTCPayServer.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.HasOne("BTCPayServer.Data.ApplicationUser")
b.HasOne("BTCPayServer.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("BTCPayServer.Data.ApplicationUser")
b.HasOne("BTCPayServer.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.HasOne("BTCPayServer.Data.ApplicationUser")
b.HasOne("BTCPayServer.Data.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}