This commit is contained in:
maja
2026-10-14 18:25:42 +02:00
9 changed files with 273 additions and 312 deletions

View File

@@ -1,10 +1,9 @@
// <auto-generated /> // <auto-generated />
using System;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using System;
using Web_Jarmark.Data; using Web_Jarmark.Data;
#nullable disable #nullable disable
@@ -12,108 +11,37 @@ using Web_Jarmark.Data;
namespace Web_Jarmark.Migrations namespace Web_Jarmark.Migrations
{ {
[DbContext(typeof(ApplicationDbContext))] [DbContext(typeof(ApplicationDbContext))]
[Migration("00000000000000_CreateIdentitySchema")] [Migration("20261014161412_InitialIdentity")]
partial class CreateIdentitySchema partial class InitialIdentity
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder.HasAnnotation("ProductVersion", "10.0.13");
.HasAnnotation("ProductVersion", "10.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("Web_Jarmark.Data.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("bit");
b.Property<bool>("LockoutEnabled")
.HasColumnType("bit");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("bit");
b.Property<string>("SecurityStamp")
.HasColumnType("nvarchar(max)");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("bit");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex")
.HasFilter("[NormalizedUserName] IS NOT NULL");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{ {
b.Property<string>("Id") b.Property<string>("Id")
.HasColumnType("nvarchar(450)"); .HasColumnType("TEXT");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()
.HasColumnType("nvarchar(max)"); .HasColumnType("TEXT");
b.Property<string>("Name") b.Property<string>("Name")
.HasMaxLength(256) .HasMaxLength(256)
.HasColumnType("nvarchar(256)"); .HasColumnType("TEXT");
b.Property<string>("NormalizedName") b.Property<string>("NormalizedName")
.HasMaxLength(256) .HasMaxLength(256)
.HasColumnType("nvarchar(256)"); .HasColumnType("TEXT");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("NormalizedName") b.HasIndex("NormalizedName")
.IsUnique() .IsUnique()
.HasDatabaseName("RoleNameIndex") .HasDatabaseName("RoleNameIndex");
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles", (string)null); b.ToTable("AspNetRoles", (string)null);
}); });
@@ -122,19 +50,17 @@ namespace Web_Jarmark.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("INTEGER");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType") b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)"); .HasColumnType("TEXT");
b.Property<string>("ClaimValue") b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)"); .HasColumnType("TEXT");
b.Property<string>("RoleId") b.Property<string>("RoleId")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(450)"); .HasColumnType("TEXT");
b.HasKey("Id"); b.HasKey("Id");
@@ -147,19 +73,17 @@ namespace Web_Jarmark.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("INTEGER");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType") b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)"); .HasColumnType("TEXT");
b.Property<string>("ClaimValue") b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)"); .HasColumnType("TEXT");
b.Property<string>("UserId") b.Property<string>("UserId")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(450)"); .HasColumnType("TEXT");
b.HasKey("Id"); b.HasKey("Id");
@@ -172,18 +96,18 @@ namespace Web_Jarmark.Migrations
{ {
b.Property<string>("LoginProvider") b.Property<string>("LoginProvider")
.HasMaxLength(128) .HasMaxLength(128)
.HasColumnType("nvarchar(128)"); .HasColumnType("TEXT");
b.Property<string>("ProviderKey") b.Property<string>("ProviderKey")
.HasMaxLength(128) .HasMaxLength(128)
.HasColumnType("nvarchar(128)"); .HasColumnType("TEXT");
b.Property<string>("ProviderDisplayName") b.Property<string>("ProviderDisplayName")
.HasColumnType("nvarchar(max)"); .HasColumnType("TEXT");
b.Property<string>("UserId") b.Property<string>("UserId")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(450)"); .HasColumnType("TEXT");
b.HasKey("LoginProvider", "ProviderKey"); b.HasKey("LoginProvider", "ProviderKey");
@@ -196,11 +120,11 @@ namespace Web_Jarmark.Migrations
{ {
b.Property<byte[]>("CredentialId") b.Property<byte[]>("CredentialId")
.HasMaxLength(1024) .HasMaxLength(1024)
.HasColumnType("varbinary(1024)"); .HasColumnType("BLOB");
b.Property<string>("UserId") b.Property<string>("UserId")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(450)"); .HasColumnType("TEXT");
b.HasKey("CredentialId"); b.HasKey("CredentialId");
@@ -212,10 +136,10 @@ namespace Web_Jarmark.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{ {
b.Property<string>("UserId") b.Property<string>("UserId")
.HasColumnType("nvarchar(450)"); .HasColumnType("TEXT");
b.Property<string>("RoleId") b.Property<string>("RoleId")
.HasColumnType("nvarchar(450)"); .HasColumnType("TEXT");
b.HasKey("UserId", "RoleId"); b.HasKey("UserId", "RoleId");
@@ -227,24 +151,89 @@ namespace Web_Jarmark.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{ {
b.Property<string>("UserId") b.Property<string>("UserId")
.HasColumnType("nvarchar(450)"); .HasColumnType("TEXT");
b.Property<string>("LoginProvider") b.Property<string>("LoginProvider")
.HasMaxLength(128) .HasMaxLength(128)
.HasColumnType("nvarchar(128)"); .HasColumnType("TEXT");
b.Property<string>("Name") b.Property<string>("Name")
.HasMaxLength(128) .HasMaxLength(128)
.HasColumnType("nvarchar(128)"); .HasColumnType("TEXT");
b.Property<string>("Value") b.Property<string>("Value")
.HasColumnType("nvarchar(max)"); .HasColumnType("TEXT");
b.HasKey("UserId", "LoginProvider", "Name"); b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null); b.ToTable("AspNetUserTokens", (string)null);
}); });
modelBuilder.Entity("Web_Jarmark.Data.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<int>("AccessFailedCount")
.HasColumnType("INTEGER");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<bool>("EmailConfirmed")
.HasColumnType("INTEGER");
b.Property<bool>("LockoutEnabled")
.HasColumnType("INTEGER");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("TEXT");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("PasswordHash")
.HasColumnType("TEXT");
b.Property<string>("PhoneNumber")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("INTEGER");
b.Property<string>("SecurityStamp")
.HasColumnType("TEXT");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("INTEGER");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{ {
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
@@ -282,47 +271,38 @@ namespace Web_Jarmark.Migrations
b.OwnsOne("Microsoft.AspNetCore.Identity.IdentityPasskeyData", "Data", b1 => b.OwnsOne("Microsoft.AspNetCore.Identity.IdentityPasskeyData", "Data", b1 =>
{ {
b1.Property<byte[]>("IdentityUserPasskeyCredentialId") b1.Property<byte[]>("IdentityUserPasskeyCredentialId");
.HasColumnType("varbinary(1024)");
b1.Property<byte[]>("AttestationObject") b1.Property<byte[]>("AttestationObject")
.IsRequired() .IsRequired();
.HasColumnType("varbinary(max)");
b1.Property<byte[]>("ClientDataJson") b1.Property<byte[]>("ClientDataJson")
.IsRequired() .IsRequired();
.HasColumnType("varbinary(max)");
b1.Property<DateTimeOffset>("CreatedAt") b1.Property<DateTimeOffset>("CreatedAt");
.HasColumnType("datetimeoffset");
b1.Property<bool>("IsBackedUp") b1.Property<bool>("IsBackedUp");
.HasColumnType("bit");
b1.Property<bool>("IsBackupEligible") b1.Property<bool>("IsBackupEligible");
.HasColumnType("bit");
b1.Property<bool>("IsUserVerified") b1.Property<bool>("IsUserVerified");
.HasColumnType("bit");
b1.Property<string>("Name") b1.Property<string>("Name");
.HasColumnType("nvarchar(max)");
b1.Property<byte[]>("PublicKey") b1.Property<byte[]>("PublicKey")
.IsRequired() .IsRequired();
.HasColumnType("varbinary(max)");
b1.Property<long>("SignCount") b1.Property<uint>("SignCount");
.HasColumnType("bigint");
b1.PrimitiveCollection<string>("Transports") b1.PrimitiveCollection<string>("Transports");
.HasColumnType("nvarchar(max)");
b1.HasKey("IdentityUserPasskeyCredentialId"); b1.HasKey("IdentityUserPasskeyCredentialId");
b1.ToTable("AspNetUserPasskeys"); b1.ToTable("AspNetUserPasskeys");
b1.ToJson("Data"); b1
.ToJson("Data")
.HasColumnType("TEXT");
b1.WithOwner() b1.WithOwner()
.HasForeignKey("IdentityUserPasskeyCredentialId"); .HasForeignKey("IdentityUserPasskeyCredentialId");

View File

@@ -1,12 +1,12 @@
using Microsoft.EntityFrameworkCore.Migrations; using System;
using System; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable
namespace Web_Jarmark.Migrations namespace Web_Jarmark.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class CreateIdentitySchema : Migration public partial class InitialIdentity : Migration
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
@@ -15,10 +15,10 @@ namespace Web_Jarmark.Migrations
name: "AspNetRoles", name: "AspNetRoles",
columns: table => new columns: table => new
{ {
Id = table.Column<string>(type: "nvarchar(450)", nullable: false), Id = table.Column<string>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), Name = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
NormalizedName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), NormalizedName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true) ConcurrencyStamp = table.Column<string>(type: "TEXT", nullable: true)
}, },
constraints: table => constraints: table =>
{ {
@@ -29,21 +29,21 @@ namespace Web_Jarmark.Migrations
name: "AspNetUsers", name: "AspNetUsers",
columns: table => new columns: table => new
{ {
Id = table.Column<string>(type: "nvarchar(450)", nullable: false), Id = table.Column<string>(type: "TEXT", nullable: false),
UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), UserName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
NormalizedUserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), NormalizedUserName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
Email = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), Email = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), NormalizedEmail = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(type: "bit", nullable: false), EmailConfirmed = table.Column<bool>(type: "INTEGER", nullable: false),
PasswordHash = table.Column<string>(type: "nvarchar(max)", nullable: true), PasswordHash = table.Column<string>(type: "TEXT", nullable: true),
SecurityStamp = table.Column<string>(type: "nvarchar(max)", nullable: true), SecurityStamp = table.Column<string>(type: "TEXT", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column<string>(type: "TEXT", nullable: true),
PhoneNumber = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), PhoneNumber = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
PhoneNumberConfirmed = table.Column<bool>(type: "bit", nullable: false), PhoneNumberConfirmed = table.Column<bool>(type: "INTEGER", nullable: false),
TwoFactorEnabled = table.Column<bool>(type: "bit", nullable: false), TwoFactorEnabled = table.Column<bool>(type: "INTEGER", nullable: false),
LockoutEnd = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true), LockoutEnd = table.Column<DateTimeOffset>(type: "TEXT", nullable: true),
LockoutEnabled = table.Column<bool>(type: "bit", nullable: false), LockoutEnabled = table.Column<bool>(type: "INTEGER", nullable: false),
AccessFailedCount = table.Column<int>(type: "int", nullable: false) AccessFailedCount = table.Column<int>(type: "INTEGER", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@@ -54,11 +54,11 @@ namespace Web_Jarmark.Migrations
name: "AspNetRoleClaims", name: "AspNetRoleClaims",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(type: "int", nullable: false) Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"), .Annotation("Sqlite:Autoincrement", true),
RoleId = table.Column<string>(type: "nvarchar(450)", nullable: false), RoleId = table.Column<string>(type: "TEXT", nullable: false),
ClaimType = table.Column<string>(type: "nvarchar(max)", nullable: true), ClaimType = table.Column<string>(type: "TEXT", nullable: true),
ClaimValue = table.Column<string>(type: "nvarchar(max)", nullable: true) ClaimValue = table.Column<string>(type: "TEXT", nullable: true)
}, },
constraints: table => constraints: table =>
{ {
@@ -75,11 +75,11 @@ namespace Web_Jarmark.Migrations
name: "AspNetUserClaims", name: "AspNetUserClaims",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(type: "int", nullable: false) Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"), .Annotation("Sqlite:Autoincrement", true),
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false), UserId = table.Column<string>(type: "TEXT", nullable: false),
ClaimType = table.Column<string>(type: "nvarchar(max)", nullable: true), ClaimType = table.Column<string>(type: "TEXT", nullable: true),
ClaimValue = table.Column<string>(type: "nvarchar(max)", nullable: true) ClaimValue = table.Column<string>(type: "TEXT", nullable: true)
}, },
constraints: table => constraints: table =>
{ {
@@ -96,10 +96,10 @@ namespace Web_Jarmark.Migrations
name: "AspNetUserLogins", name: "AspNetUserLogins",
columns: table => new columns: table => new
{ {
LoginProvider = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), LoginProvider = table.Column<string>(type: "TEXT", maxLength: 128, nullable: false),
ProviderKey = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), ProviderKey = table.Column<string>(type: "TEXT", maxLength: 128, nullable: false),
ProviderDisplayName = table.Column<string>(type: "nvarchar(max)", nullable: true), ProviderDisplayName = table.Column<string>(type: "TEXT", nullable: true),
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false) UserId = table.Column<string>(type: "TEXT", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@@ -116,9 +116,9 @@ namespace Web_Jarmark.Migrations
name: "AspNetUserPasskeys", name: "AspNetUserPasskeys",
columns: table => new columns: table => new
{ {
CredentialId = table.Column<byte[]>(type: "varbinary(1024)", maxLength: 1024, nullable: false), CredentialId = table.Column<byte[]>(type: "BLOB", maxLength: 1024, nullable: false),
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false), UserId = table.Column<string>(type: "TEXT", nullable: false),
Data = table.Column<string>(type: "nvarchar(max)", nullable: false) Data = table.Column<string>(type: "TEXT", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@@ -135,8 +135,8 @@ namespace Web_Jarmark.Migrations
name: "AspNetUserRoles", name: "AspNetUserRoles",
columns: table => new columns: table => new
{ {
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false), UserId = table.Column<string>(type: "TEXT", nullable: false),
RoleId = table.Column<string>(type: "nvarchar(450)", nullable: false) RoleId = table.Column<string>(type: "TEXT", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@@ -159,10 +159,10 @@ namespace Web_Jarmark.Migrations
name: "AspNetUserTokens", name: "AspNetUserTokens",
columns: table => new columns: table => new
{ {
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false), UserId = table.Column<string>(type: "TEXT", nullable: false),
LoginProvider = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), LoginProvider = table.Column<string>(type: "TEXT", maxLength: 128, nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), Name = table.Column<string>(type: "TEXT", maxLength: 128, nullable: false),
Value = table.Column<string>(type: "nvarchar(max)", nullable: true) Value = table.Column<string>(type: "TEXT", nullable: true)
}, },
constraints: table => constraints: table =>
{ {
@@ -184,8 +184,7 @@ namespace Web_Jarmark.Migrations
name: "RoleNameIndex", name: "RoleNameIndex",
table: "AspNetRoles", table: "AspNetRoles",
column: "NormalizedName", column: "NormalizedName",
unique: true, unique: true);
filter: "[NormalizedName] IS NOT NULL");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_AspNetUserClaims_UserId", name: "IX_AspNetUserClaims_UserId",
@@ -216,8 +215,7 @@ namespace Web_Jarmark.Migrations
name: "UserNameIndex", name: "UserNameIndex",
table: "AspNetUsers", table: "AspNetUsers",
column: "NormalizedUserName", column: "NormalizedUserName",
unique: true, unique: true);
filter: "[NormalizedUserName] IS NOT NULL");
} }
/// <inheritdoc /> /// <inheritdoc />

View File

@@ -1,9 +1,8 @@
// <auto-generated /> // <auto-generated />
using System;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using System;
using Web_Jarmark.Data; using Web_Jarmark.Data;
#nullable disable #nullable disable
@@ -16,101 +15,30 @@ namespace Web_Jarmark.Migrations
protected override void BuildModel(ModelBuilder modelBuilder) protected override void BuildModel(ModelBuilder modelBuilder)
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder.HasAnnotation("ProductVersion", "10.0.13");
.HasAnnotation("ProductVersion", "10.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("Web_Jarmark.Data.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("nvarchar(450)");
b.Property<int>("AccessFailedCount")
.HasColumnType("int");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("bit");
b.Property<bool>("LockoutEnabled")
.HasColumnType("bit");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("datetimeoffset");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("bit");
b.Property<string>("SecurityStamp")
.HasColumnType("nvarchar(max)");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("bit");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex")
.HasFilter("[NormalizedUserName] IS NOT NULL");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{ {
b.Property<string>("Id") b.Property<string>("Id")
.HasColumnType("nvarchar(450)"); .HasColumnType("TEXT");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()
.HasColumnType("nvarchar(max)"); .HasColumnType("TEXT");
b.Property<string>("Name") b.Property<string>("Name")
.HasMaxLength(256) .HasMaxLength(256)
.HasColumnType("nvarchar(256)"); .HasColumnType("TEXT");
b.Property<string>("NormalizedName") b.Property<string>("NormalizedName")
.HasMaxLength(256) .HasMaxLength(256)
.HasColumnType("nvarchar(256)"); .HasColumnType("TEXT");
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("NormalizedName") b.HasIndex("NormalizedName")
.IsUnique() .IsUnique()
.HasDatabaseName("RoleNameIndex") .HasDatabaseName("RoleNameIndex");
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles", (string)null); b.ToTable("AspNetRoles", (string)null);
}); });
@@ -119,19 +47,17 @@ namespace Web_Jarmark.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("INTEGER");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType") b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)"); .HasColumnType("TEXT");
b.Property<string>("ClaimValue") b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)"); .HasColumnType("TEXT");
b.Property<string>("RoleId") b.Property<string>("RoleId")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(450)"); .HasColumnType("TEXT");
b.HasKey("Id"); b.HasKey("Id");
@@ -144,19 +70,17 @@ namespace Web_Jarmark.Migrations
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("INTEGER");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType") b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)"); .HasColumnType("TEXT");
b.Property<string>("ClaimValue") b.Property<string>("ClaimValue")
.HasColumnType("nvarchar(max)"); .HasColumnType("TEXT");
b.Property<string>("UserId") b.Property<string>("UserId")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(450)"); .HasColumnType("TEXT");
b.HasKey("Id"); b.HasKey("Id");
@@ -169,18 +93,18 @@ namespace Web_Jarmark.Migrations
{ {
b.Property<string>("LoginProvider") b.Property<string>("LoginProvider")
.HasMaxLength(128) .HasMaxLength(128)
.HasColumnType("nvarchar(128)"); .HasColumnType("TEXT");
b.Property<string>("ProviderKey") b.Property<string>("ProviderKey")
.HasMaxLength(128) .HasMaxLength(128)
.HasColumnType("nvarchar(128)"); .HasColumnType("TEXT");
b.Property<string>("ProviderDisplayName") b.Property<string>("ProviderDisplayName")
.HasColumnType("nvarchar(max)"); .HasColumnType("TEXT");
b.Property<string>("UserId") b.Property<string>("UserId")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(450)"); .HasColumnType("TEXT");
b.HasKey("LoginProvider", "ProviderKey"); b.HasKey("LoginProvider", "ProviderKey");
@@ -193,11 +117,11 @@ namespace Web_Jarmark.Migrations
{ {
b.Property<byte[]>("CredentialId") b.Property<byte[]>("CredentialId")
.HasMaxLength(1024) .HasMaxLength(1024)
.HasColumnType("varbinary(1024)"); .HasColumnType("BLOB");
b.Property<string>("UserId") b.Property<string>("UserId")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(450)"); .HasColumnType("TEXT");
b.HasKey("CredentialId"); b.HasKey("CredentialId");
@@ -209,10 +133,10 @@ namespace Web_Jarmark.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{ {
b.Property<string>("UserId") b.Property<string>("UserId")
.HasColumnType("nvarchar(450)"); .HasColumnType("TEXT");
b.Property<string>("RoleId") b.Property<string>("RoleId")
.HasColumnType("nvarchar(450)"); .HasColumnType("TEXT");
b.HasKey("UserId", "RoleId"); b.HasKey("UserId", "RoleId");
@@ -224,24 +148,89 @@ namespace Web_Jarmark.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{ {
b.Property<string>("UserId") b.Property<string>("UserId")
.HasColumnType("nvarchar(450)"); .HasColumnType("TEXT");
b.Property<string>("LoginProvider") b.Property<string>("LoginProvider")
.HasMaxLength(128) .HasMaxLength(128)
.HasColumnType("nvarchar(128)"); .HasColumnType("TEXT");
b.Property<string>("Name") b.Property<string>("Name")
.HasMaxLength(128) .HasMaxLength(128)
.HasColumnType("nvarchar(128)"); .HasColumnType("TEXT");
b.Property<string>("Value") b.Property<string>("Value")
.HasColumnType("nvarchar(max)"); .HasColumnType("TEXT");
b.HasKey("UserId", "LoginProvider", "Name"); b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null); b.ToTable("AspNetUserTokens", (string)null);
}); });
modelBuilder.Entity("Web_Jarmark.Data.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<int>("AccessFailedCount")
.HasColumnType("INTEGER");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<bool>("EmailConfirmed")
.HasColumnType("INTEGER");
b.Property<bool>("LockoutEnabled")
.HasColumnType("INTEGER");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("TEXT");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<string>("PasswordHash")
.HasColumnType("TEXT");
b.Property<string>("PhoneNumber")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("INTEGER");
b.Property<string>("SecurityStamp")
.HasColumnType("TEXT");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("INTEGER");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{ {
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
@@ -279,47 +268,38 @@ namespace Web_Jarmark.Migrations
b.OwnsOne("Microsoft.AspNetCore.Identity.IdentityPasskeyData", "Data", b1 => b.OwnsOne("Microsoft.AspNetCore.Identity.IdentityPasskeyData", "Data", b1 =>
{ {
b1.Property<byte[]>("IdentityUserPasskeyCredentialId") b1.Property<byte[]>("IdentityUserPasskeyCredentialId");
.HasColumnType("varbinary(1024)");
b1.Property<byte[]>("AttestationObject") b1.Property<byte[]>("AttestationObject")
.IsRequired() .IsRequired();
.HasColumnType("varbinary(max)");
b1.Property<byte[]>("ClientDataJson") b1.Property<byte[]>("ClientDataJson")
.IsRequired() .IsRequired();
.HasColumnType("varbinary(max)");
b1.Property<DateTimeOffset>("CreatedAt") b1.Property<DateTimeOffset>("CreatedAt");
.HasColumnType("datetimeoffset");
b1.Property<bool>("IsBackedUp") b1.Property<bool>("IsBackedUp");
.HasColumnType("bit");
b1.Property<bool>("IsBackupEligible") b1.Property<bool>("IsBackupEligible");
.HasColumnType("bit");
b1.Property<bool>("IsUserVerified") b1.Property<bool>("IsUserVerified");
.HasColumnType("bit");
b1.Property<string>("Name") b1.Property<string>("Name");
.HasColumnType("nvarchar(max)");
b1.Property<byte[]>("PublicKey") b1.Property<byte[]>("PublicKey")
.IsRequired() .IsRequired();
.HasColumnType("varbinary(max)");
b1.Property<long>("SignCount") b1.Property<uint>("SignCount");
.HasColumnType("bigint");
b1.PrimitiveCollection<string>("Transports") b1.PrimitiveCollection<string>("Transports");
.HasColumnType("nvarchar(max)");
b1.HasKey("IdentityUserPasskeyCredentialId"); b1.HasKey("IdentityUserPasskeyCredentialId");
b1.ToTable("AspNetUserPasskeys"); b1.ToTable("AspNetUserPasskeys");
b1.ToJson("Data"); b1
.ToJson("Data")
.HasColumnType("TEXT");
b1.WithOwner() b1.WithOwner()
.HasForeignKey("IdentityUserPasskeyCredentialId"); .HasForeignKey("IdentityUserPasskeyCredentialId");

View File

@@ -24,7 +24,7 @@ builder.Services.AddAuthentication(options =>
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found."); var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found.");
builder.Services.AddDbContext<ApplicationDbContext>(options => builder.Services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(connectionString)); options.UseSqlite(connectionString));
builder.Services.AddDatabaseDeveloperPageExceptionFilter(); builder.Services.AddDatabaseDeveloperPageExceptionFilter();
builder.Services.AddIdentityCore<ApplicationUser>(options => builder.Services.AddIdentityCore<ApplicationUser>(options =>

View File

@@ -11,11 +11,14 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="10.0.12" /> <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="10.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.0.12" /> <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="10.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.12" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.13" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.12" PrivateAssets="all" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.13" PrivateAssets="all" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.12" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.13">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -1,6 +1,6 @@
{ {
"ConnectionStrings": { "ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-Web_Jarmark-55b8bf19-aa16-438e-aa20-26e3a86f98ae;Trusted_Connection=True;MultipleActiveResultSets=true" "DefaultConnection": "Data Source=jarmark.db"
}, },
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {

Binary file not shown.

Binary file not shown.

Binary file not shown.