//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Yi.Framework.Model;
namespace Yi.Framework.Model.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20211106080646_ec2")]
partial class ec2
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 64)
.HasAnnotation("ProductVersion", "5.0.11");
modelBuilder.Entity("Yi.Framework.Model.Models.brand", b =>
{
b.Property("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("image")
.HasColumnType("longtext");
b.Property("is_delete")
.HasColumnType("int");
b.Property("letter")
.HasColumnType("longtext");
b.Property("name")
.HasColumnType("longtext");
b.HasKey("id");
b.ToTable("brand");
});
modelBuilder.Entity("Yi.Framework.Model.Models.brand_category", b =>
{
b.Property("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("brandId")
.HasColumnType("int");
b.Property("categoryId")
.HasColumnType("int");
b.Property("is_delete")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("brandId");
b.HasIndex("categoryId");
b.ToTable("brand_category");
});
modelBuilder.Entity("Yi.Framework.Model.Models.category", b =>
{
b.Property("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("categoryid")
.HasColumnType("int");
b.Property("is_delete")
.HasColumnType("int");
b.Property("is_parent")
.HasColumnType("int");
b.Property("name")
.HasColumnType("longtext");
b.Property("sort")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("categoryid");
b.ToTable("category");
});
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
{
b.Property("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("icon")
.HasColumnType("longtext");
b.Property("is_delete")
.HasColumnType("int");
b.Property("is_show")
.HasColumnType("int");
b.Property("is_top")
.HasColumnType("int");
b.Property("menu_name")
.HasColumnType("longtext");
b.Property("menuid")
.HasColumnType("int");
b.Property("mouldid")
.HasColumnType("int");
b.Property("roleid")
.HasColumnType("int");
b.Property("router")
.HasColumnType("longtext");
b.Property("sort")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("menuid");
b.HasIndex("mouldid");
b.HasIndex("roleid");
b.ToTable("menu");
});
modelBuilder.Entity("Yi.Framework.Model.Models.mould", b =>
{
b.Property("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("is_delete")
.HasColumnType("int");
b.Property("mould_name")
.HasColumnType("longtext");
b.Property("url")
.HasColumnType("longtext");
b.HasKey("id");
b.ToTable("mould");
});
modelBuilder.Entity("Yi.Framework.Model.Models.order", b =>
{
b.Property("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("actual_pay")
.HasColumnType("int");
b.Property("buyer_message")
.HasColumnType("longtext");
b.Property("buyer_nick")
.HasColumnType("longtext");
b.Property("buyer_rate")
.HasColumnType("int");
b.Property("creat_time")
.HasColumnType("datetime(6)");
b.Property("invoice_type")
.HasColumnType("int");
b.Property("is_delete")
.HasColumnType("int");
b.Property("payment_type")
.HasColumnType("int");
b.Property("post_fee")
.HasColumnType("int");
b.Property("promotion_ids")
.HasColumnType("longtext");
b.Property("receiver")
.HasColumnType("longtext");
b.Property("receiver_address")
.HasColumnType("longtext");
b.Property("receiver_city")
.HasColumnType("longtext");
b.Property("receiver_district")
.HasColumnType("longtext");
b.Property("receiver_mobile")
.HasColumnType("longtext");
b.Property("receiver_state")
.HasColumnType("longtext");
b.Property("receiver_zip")
.HasColumnType("longtext");
b.Property("shipping_code")
.HasColumnType("longtext");
b.Property("shipping_name")
.HasColumnType("longtext");
b.Property("skuid")
.HasColumnType("int");
b.Property("source_type")
.HasColumnType("int");
b.Property("total_pay")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("skuid");
b.ToTable("order");
});
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
{
b.Property("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("introduce")
.HasColumnType("longtext");
b.Property("is_delete")
.HasColumnType("int");
b.Property("role_name")
.HasColumnType("longtext");
b.Property("userid")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("userid");
b.ToTable("role");
});
modelBuilder.Entity("Yi.Framework.Model.Models.sku", b =>
{
b.Property("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("crate_time")
.HasColumnType("datetime(6)");
b.Property("enable")
.HasColumnType("int");
b.Property("images")
.HasColumnType("longtext");
b.Property("indexes")
.HasColumnType("longtext");
b.Property("is_delete")
.HasColumnType("int");
b.Property("last_update_time")
.HasColumnType("datetime(6)");
b.Property("own_spec")
.HasColumnType("longtext");
b.Property("price")
.HasColumnType("int");
b.Property("spuid")
.HasColumnType("int");
b.Property("title")
.HasColumnType("longtext");
b.HasKey("id");
b.HasIndex("spuid");
b.ToTable("sku");
});
modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b =>
{
b.Property("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("categoryid")
.HasColumnType("int");
b.Property("is_delete")
.HasColumnType("int");
b.Property("name")
.HasColumnType("longtext");
b.HasKey("id");
b.HasIndex("categoryid");
b.ToTable("spec_group");
});
modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b =>
{
b.Property("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("categoryid")
.HasColumnType("int");
b.Property("generic")
.HasColumnType("int");
b.Property("is_delete")
.HasColumnType("int");
b.Property("name")
.HasColumnType("longtext");
b.Property("numeric")
.HasColumnType("int");
b.Property("searching")
.HasColumnType("int");
b.Property("segments")
.HasColumnType("longtext");
b.Property("spec_Groupid")
.HasColumnType("int");
b.Property("unit")
.HasColumnType("longtext");
b.HasKey("id");
b.HasIndex("categoryid");
b.HasIndex("spec_Groupid");
b.ToTable("spec_param");
});
modelBuilder.Entity("Yi.Framework.Model.Models.spu", b =>
{
b.Property("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("brandid")
.HasColumnType("int");
b.Property("crate_time")
.HasColumnType("datetime(6)");
b.Property("is_delete")
.HasColumnType("int");
b.Property("last_update_time")
.HasColumnType("datetime(6)");
b.Property("saleable")
.HasColumnType("int");
b.Property("spu_Detailid")
.HasColumnType("int");
b.Property("sub_title")
.HasColumnType("longtext");
b.Property("title")
.HasColumnType("longtext");
b.Property("valid")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("brandid");
b.HasIndex("spu_Detailid");
b.ToTable("spu");
});
modelBuilder.Entity("Yi.Framework.Model.Models.spu_detail", b =>
{
b.Property("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("after_service")
.HasColumnType("longtext");
b.Property("description")
.HasColumnType("longtext");
b.Property("generic_spec")
.HasColumnType("longtext");
b.Property("is_delete")
.HasColumnType("int");
b.Property("packing_list")
.HasColumnType("longtext");
b.Property("special_spec")
.HasColumnType("longtext");
b.HasKey("id");
b.ToTable("spu_detail");
});
modelBuilder.Entity("Yi.Framework.Model.Models.stock", b =>
{
b.Property("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("is_delete")
.HasColumnType("int");
b.Property("seckill_stock")
.HasColumnType("int");
b.Property("seckill_total")
.HasColumnType("int");
b.Property("skuid")
.HasColumnType("int");
b.Property("stock_count")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("skuid");
b.ToTable("stock");
});
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
{
b.Property("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("address")
.HasColumnType("longtext");
b.Property("age")
.HasColumnType("int");
b.Property("email")
.HasColumnType("longtext");
b.Property("icon")
.HasColumnType("longtext");
b.Property("introduction")
.HasColumnType("longtext");
b.Property("ip")
.HasColumnType("longtext");
b.Property("is_delete")
.HasColumnType("int");
b.Property("nick")
.HasColumnType("longtext");
b.Property("password")
.HasColumnType("longtext");
b.Property("phone")
.HasColumnType("int");
b.Property("username")
.HasColumnType("longtext");
b.HasKey("id");
b.ToTable("user");
});
modelBuilder.Entity("Yi.Framework.Model.Models.visit", b =>
{
b.Property("id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property("is_delete")
.HasColumnType("int");
b.Property("num")
.HasColumnType("int");
b.Property("time")
.HasColumnType("datetime(6)");
b.HasKey("id");
b.ToTable("visit");
});
modelBuilder.Entity("categoryspu", b =>
{
b.Property("categoriesid")
.HasColumnType("int");
b.Property("spusid")
.HasColumnType("int");
b.HasKey("categoriesid", "spusid");
b.HasIndex("spusid");
b.ToTable("categoryspu");
});
modelBuilder.Entity("Yi.Framework.Model.Models.brand_category", b =>
{
b.HasOne("Yi.Framework.Model.Models.brand", "brand")
.WithMany("categories")
.HasForeignKey("brandId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Yi.Framework.Model.Models.category", "category")
.WithMany("brands")
.HasForeignKey("categoryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("brand");
b.Navigation("category");
});
modelBuilder.Entity("Yi.Framework.Model.Models.category", b =>
{
b.HasOne("Yi.Framework.Model.Models.category", null)
.WithMany("chidrens")
.HasForeignKey("categoryid");
});
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
{
b.HasOne("Yi.Framework.Model.Models.menu", null)
.WithMany("children")
.HasForeignKey("menuid");
b.HasOne("Yi.Framework.Model.Models.mould", "mould")
.WithMany()
.HasForeignKey("mouldid");
b.HasOne("Yi.Framework.Model.Models.role", null)
.WithMany("menus")
.HasForeignKey("roleid");
b.Navigation("mould");
});
modelBuilder.Entity("Yi.Framework.Model.Models.order", b =>
{
b.HasOne("Yi.Framework.Model.Models.sku", null)
.WithMany("orders")
.HasForeignKey("skuid");
});
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
{
b.HasOne("Yi.Framework.Model.Models.user", null)
.WithMany("roles")
.HasForeignKey("userid");
});
modelBuilder.Entity("Yi.Framework.Model.Models.sku", b =>
{
b.HasOne("Yi.Framework.Model.Models.spu", "spu")
.WithMany("skus")
.HasForeignKey("spuid");
b.Navigation("spu");
});
modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b =>
{
b.HasOne("Yi.Framework.Model.Models.category", "category")
.WithMany("spec_Groups")
.HasForeignKey("categoryid");
b.Navigation("category");
});
modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b =>
{
b.HasOne("Yi.Framework.Model.Models.category", "category")
.WithMany("spec_Params")
.HasForeignKey("categoryid");
b.HasOne("Yi.Framework.Model.Models.spec_group", "spec_Group")
.WithMany("spec_Params")
.HasForeignKey("spec_Groupid");
b.Navigation("category");
b.Navigation("spec_Group");
});
modelBuilder.Entity("Yi.Framework.Model.Models.spu", b =>
{
b.HasOne("Yi.Framework.Model.Models.brand", "brand")
.WithMany("spus")
.HasForeignKey("brandid");
b.HasOne("Yi.Framework.Model.Models.spu_detail", "spu_Detail")
.WithMany()
.HasForeignKey("spu_Detailid");
b.Navigation("brand");
b.Navigation("spu_Detail");
});
modelBuilder.Entity("Yi.Framework.Model.Models.stock", b =>
{
b.HasOne("Yi.Framework.Model.Models.sku", "sku")
.WithMany()
.HasForeignKey("skuid");
b.Navigation("sku");
});
modelBuilder.Entity("categoryspu", b =>
{
b.HasOne("Yi.Framework.Model.Models.category", null)
.WithMany()
.HasForeignKey("categoriesid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Yi.Framework.Model.Models.spu", null)
.WithMany()
.HasForeignKey("spusid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Yi.Framework.Model.Models.brand", b =>
{
b.Navigation("categories");
b.Navigation("spus");
});
modelBuilder.Entity("Yi.Framework.Model.Models.category", b =>
{
b.Navigation("brands");
b.Navigation("chidrens");
b.Navigation("spec_Groups");
b.Navigation("spec_Params");
});
modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
{
b.Navigation("children");
});
modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
{
b.Navigation("menus");
});
modelBuilder.Entity("Yi.Framework.Model.Models.sku", b =>
{
b.Navigation("orders");
});
modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b =>
{
b.Navigation("spec_Params");
});
modelBuilder.Entity("Yi.Framework.Model.Models.spu", b =>
{
b.Navigation("skus");
});
modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
{
b.Navigation("roles");
});
#pragma warning restore 612, 618
}
}
}