412 lines
14 KiB
C#
412 lines
14 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using UTB.Eshop.Web.Models.Database;
|
|
|
|
namespace UTB.Eshop.Web.Migrations.MySql
|
|
{
|
|
[DbContext(typeof(EshopDbContext))]
|
|
[Migration("20211129083511_MySql_1.0.3")]
|
|
partial class MySql_103
|
|
{
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 64)
|
|
.HasAnnotation("ProductVersion", "5.0.12");
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ClaimType")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("ClaimValue")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("RoleId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.ToTable("RoleClaims");
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ClaimType")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("ClaimValue")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("UserClaims");
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
|
|
{
|
|
b.Property<string>("LoginProvider")
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<string>("ProviderKey")
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<string>("ProviderDisplayName")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("LoginProvider", "ProviderKey");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("UserLogins");
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
|
|
{
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("RoleId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("UserId", "RoleId");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.ToTable("UserRoles");
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
|
|
{
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("LoginProvider")
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<string>("Name")
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<string>("Value")
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("UserId", "LoginProvider", "Name");
|
|
|
|
b.ToTable("UserTokens");
|
|
});
|
|
|
|
modelBuilder.Entity("UTB.Eshop.Web.Models.Entity.CarouselItem", b =>
|
|
{
|
|
b.Property<int>("ID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ImageAlt")
|
|
.HasMaxLength(50)
|
|
.HasColumnType("varchar(50)");
|
|
|
|
b.Property<string>("ImageSource")
|
|
.IsRequired()
|
|
.HasMaxLength(255)
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.HasKey("ID");
|
|
|
|
b.ToTable("CarouselItem");
|
|
});
|
|
|
|
modelBuilder.Entity("UTB.Eshop.Web.Models.Entity.Order", b =>
|
|
{
|
|
b.Property<int>("ID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("DateTimeCreated")
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("datetime(6)")
|
|
.HasDefaultValueSql("NOW(6);");
|
|
|
|
b.Property<string>("OrderNumber")
|
|
.IsRequired()
|
|
.HasMaxLength(25)
|
|
.HasColumnType("varchar(25)");
|
|
|
|
b.Property<double>("TotalPrice")
|
|
.HasColumnType("double");
|
|
|
|
b.Property<int>("UserId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("ID");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("Order");
|
|
});
|
|
|
|
modelBuilder.Entity("UTB.Eshop.Web.Models.Entity.OrderItem", b =>
|
|
{
|
|
b.Property<int>("ID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Amount")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("OrderID")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<double>("Price")
|
|
.HasColumnType("double");
|
|
|
|
b.Property<int>("ProductID")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("ID");
|
|
|
|
b.HasIndex("OrderID");
|
|
|
|
b.HasIndex("ProductID");
|
|
|
|
b.ToTable("OrderItem");
|
|
});
|
|
|
|
modelBuilder.Entity("UTB.Eshop.Web.Models.Entity.Product", b =>
|
|
{
|
|
b.Property<int>("ID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("ImageSource")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<double>("Price")
|
|
.HasColumnType("double");
|
|
|
|
b.Property<int>("Quantity")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("ID");
|
|
|
|
b.ToTable("Product");
|
|
});
|
|
|
|
modelBuilder.Entity("UTB.Eshop.Web.Models.Identity.Role", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ConcurrencyStamp")
|
|
.IsConcurrencyToken()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("Name")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("varchar(256)");
|
|
|
|
b.Property<string>("NormalizedName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("varchar(256)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("NormalizedName")
|
|
.IsUnique()
|
|
.HasDatabaseName("RoleNameIndex");
|
|
|
|
b.ToTable("Roles");
|
|
});
|
|
|
|
modelBuilder.Entity("UTB.Eshop.Web.Models.Identity.User", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("AccessFailedCount")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ConcurrencyStamp")
|
|
.IsConcurrencyToken()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("Email")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("varchar(256)");
|
|
|
|
b.Property<bool>("EmailConfirmed")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("FirstName")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("LastName")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<bool>("LockoutEnabled")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<DateTimeOffset?>("LockoutEnd")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("NormalizedEmail")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("varchar(256)");
|
|
|
|
b.Property<string>("NormalizedUserName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("varchar(256)");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("PhoneNumber")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<bool>("PhoneNumberConfirmed")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("SecurityStamp")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<bool>("TwoFactorEnabled")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("UserName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("varchar(256)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("NormalizedEmail")
|
|
.HasDatabaseName("EmailIndex");
|
|
|
|
b.HasIndex("NormalizedUserName")
|
|
.IsUnique()
|
|
.HasDatabaseName("UserNameIndex");
|
|
|
|
b.ToTable("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
|
|
{
|
|
b.HasOne("UTB.Eshop.Web.Models.Identity.Role", null)
|
|
.WithMany()
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
|
|
{
|
|
b.HasOne("UTB.Eshop.Web.Models.Identity.User", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
|
|
{
|
|
b.HasOne("UTB.Eshop.Web.Models.Identity.User", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
|
|
{
|
|
b.HasOne("UTB.Eshop.Web.Models.Identity.Role", null)
|
|
.WithMany()
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("UTB.Eshop.Web.Models.Identity.User", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
|
|
{
|
|
b.HasOne("UTB.Eshop.Web.Models.Identity.User", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("UTB.Eshop.Web.Models.Entity.Order", b =>
|
|
{
|
|
b.HasOne("UTB.Eshop.Web.Models.Identity.User", "User")
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("UTB.Eshop.Web.Models.Entity.OrderItem", b =>
|
|
{
|
|
b.HasOne("UTB.Eshop.Web.Models.Entity.Order", "Order")
|
|
.WithMany("OrderItems")
|
|
.HasForeignKey("OrderID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("UTB.Eshop.Web.Models.Entity.Product", "Product")
|
|
.WithMany()
|
|
.HasForeignKey("ProductID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Order");
|
|
|
|
b.Navigation("Product");
|
|
});
|
|
|
|
modelBuilder.Entity("UTB.Eshop.Web.Models.Entity.Order", b =>
|
|
{
|
|
b.Navigation("OrderItems");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|