// <auto-generated />
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("20211106110713_ec4")]
    partial class ec4
    {
        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<int>("id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("image")
                        .HasColumnType("longtext")
                        .HasComment("品牌图片");

                    b.Property<int>("is_delete")
                        .HasColumnType("int");

                    b.Property<string>("letter")
                        .HasColumnType("longtext")
                        .HasComment("品牌首字母");

                    b.Property<string>("name")
                        .HasColumnType("longtext")
                        .HasComment("品牌名称");

                    b.HasKey("id");

                    b.ToTable("brand");
                });

            modelBuilder.Entity("Yi.Framework.Model.Models.category", b =>
                {
                    b.Property<int>("id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int?>("categoryid")
                        .HasColumnType("int");

                    b.Property<int>("is_delete")
                        .HasColumnType("int");

                    b.Property<int>("is_parent")
                        .HasColumnType("int")
                        .HasComment("是否父类别");

                    b.Property<string>("name")
                        .HasColumnType("longtext")
                        .HasComment("类别名称");

                    b.Property<int>("sort")
                        .HasColumnType("int")
                        .HasComment("排序");

                    b.HasKey("id");

                    b.HasIndex("categoryid");

                    b.ToTable("category");
                });

            modelBuilder.Entity("Yi.Framework.Model.Models.menu", b =>
                {
                    b.Property<int>("id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("icon")
                        .HasColumnType("longtext");

                    b.Property<int>("is_delete")
                        .HasColumnType("int");

                    b.Property<int>("is_show")
                        .HasColumnType("int");

                    b.Property<int>("is_top")
                        .HasColumnType("int");

                    b.Property<string>("menu_name")
                        .HasColumnType("longtext");

                    b.Property<int?>("menuid")
                        .HasColumnType("int");

                    b.Property<int?>("mouldid")
                        .HasColumnType("int");

                    b.Property<string>("router")
                        .HasColumnType("longtext");

                    b.Property<int>("sort")
                        .HasColumnType("int");

                    b.HasKey("id");

                    b.HasIndex("menuid");

                    b.HasIndex("mouldid");

                    b.ToTable("menu");
                });

            modelBuilder.Entity("Yi.Framework.Model.Models.mould", b =>
                {
                    b.Property<int>("id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int>("is_delete")
                        .HasColumnType("int");

                    b.Property<string>("mould_name")
                        .HasColumnType("longtext");

                    b.Property<string>("url")
                        .HasColumnType("longtext");

                    b.HasKey("id");

                    b.ToTable("mould");
                });

            modelBuilder.Entity("Yi.Framework.Model.Models.order", b =>
                {
                    b.Property<int>("id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int>("actual_pay")
                        .HasColumnType("int")
                        .HasComment("实付金额。单位:分。如:20007，表示:200元7分");

                    b.Property<string>("buyer_message")
                        .HasColumnType("longtext")
                        .HasComment("买家留言");

                    b.Property<string>("buyer_nick")
                        .HasColumnType("longtext")
                        .HasComment("买家昵称");

                    b.Property<int>("buyer_rate")
                        .HasColumnType("int")
                        .HasComment("买家是否已经评价,0未评价，1已评价");

                    b.Property<DateTime>("creat_time")
                        .HasColumnType("datetime(6)")
                        .HasComment("订单创建时间");

                    b.Property<int>("invoice_type")
                        .HasColumnType("int")
                        .HasComment("发票类型:0无发票1普通发票，2电子发票，3增值税发票");

                    b.Property<int>("is_delete")
                        .HasColumnType("int");

                    b.Property<int>("payment_type")
                        .HasColumnType("int")
                        .HasComment("支付类型，1、在线支付，2、货到付款");

                    b.Property<int>("post_fee")
                        .HasColumnType("int")
                        .HasComment("邮费。单位:分。如:20007，表示:200元7分");

                    b.Property<string>("promotion_ids")
                        .HasColumnType("longtext")
                        .HasComment("promotion_ids");

                    b.Property<string>("receiver")
                        .HasColumnType("longtext")
                        .HasComment("收货人");

                    b.Property<string>("receiver_address")
                        .HasColumnType("longtext")
                        .HasComment("收获地址（街道、住址等详细地址）");

                    b.Property<string>("receiver_city")
                        .HasColumnType("longtext")
                        .HasComment("收获地址（市）");

                    b.Property<string>("receiver_district")
                        .HasColumnType("longtext")
                        .HasComment("收获地址（区/县）");

                    b.Property<string>("receiver_mobile")
                        .HasColumnType("longtext")
                        .HasComment("收货人手机");

                    b.Property<string>("receiver_state")
                        .HasColumnType("longtext")
                        .HasComment("收获地址（省）");

                    b.Property<string>("receiver_zip")
                        .HasColumnType("longtext")
                        .HasComment("收货人邮编");

                    b.Property<string>("shipping_code")
                        .HasColumnType("longtext")
                        .HasComment("物流单号");

                    b.Property<string>("shipping_name")
                        .HasColumnType("longtext")
                        .HasComment("物流名称");

                    b.Property<int?>("skuid")
                        .HasColumnType("int");

                    b.Property<int>("source_type")
                        .HasColumnType("int")
                        .HasComment("订单来源：1:app端，2：pc端，3：M端，4：微信端，5：手机qq端");

                    b.Property<int>("total_pay")
                        .HasColumnType("int")
                        .HasComment("总金额，单位为分");

                    b.HasKey("id");

                    b.HasIndex("skuid");

                    b.ToTable("order");
                });

            modelBuilder.Entity("Yi.Framework.Model.Models.role", b =>
                {
                    b.Property<int>("id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("introduce")
                        .HasColumnType("longtext");

                    b.Property<int>("is_delete")
                        .HasColumnType("int");

                    b.Property<string>("role_name")
                        .HasColumnType("longtext");

                    b.HasKey("id");

                    b.ToTable("role");
                });

            modelBuilder.Entity("Yi.Framework.Model.Models.sku", b =>
                {
                    b.Property<int>("id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<DateTime>("crate_time")
                        .HasColumnType("datetime(6)")
                        .HasComment("创建时间");

                    b.Property<int>("enable")
                        .HasColumnType("int")
                        .HasComment("是否有效，0无效，1有效");

                    b.Property<string>("images")
                        .HasColumnType("longtext")
                        .HasComment("商品的图片，多个图片以‘,’分割");

                    b.Property<string>("indexes")
                        .HasColumnType("longtext")
                        .HasComment("特有规格属性在spu属性模板中的对应下标组合");

                    b.Property<int>("is_delete")
                        .HasColumnType("int");

                    b.Property<DateTime>("last_update_time")
                        .HasColumnType("datetime(6)")
                        .HasComment("最后更新时间");

                    b.Property<string>("own_spec")
                        .HasColumnType("longtext")
                        .HasComment("sku的特有规格参数键值对，json格式，反序列化时请使用linkedHashMap，保证有序");

                    b.Property<int>("price")
                        .HasColumnType("int")
                        .HasComment("销售价格，单位为分");

                    b.Property<int?>("spuid")
                        .HasColumnType("int");

                    b.Property<string>("title")
                        .HasColumnType("longtext")
                        .HasComment("商品标题");

                    b.HasKey("id");

                    b.HasIndex("spuid");

                    b.ToTable("sku");
                });

            modelBuilder.Entity("Yi.Framework.Model.Models.spec_group", b =>
                {
                    b.Property<int>("id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int?>("categoryid")
                        .HasColumnType("int");

                    b.Property<int>("is_delete")
                        .HasColumnType("int");

                    b.Property<string>("name")
                        .HasColumnType("longtext")
                        .HasComment("规格组名称");

                    b.HasKey("id");

                    b.HasIndex("categoryid");

                    b.ToTable("spec_group");
                });

            modelBuilder.Entity("Yi.Framework.Model.Models.spec_param", b =>
                {
                    b.Property<int>("id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int?>("categoryid")
                        .HasColumnType("int");

                    b.Property<int>("generic")
                        .HasColumnType("int")
                        .HasComment("是否是sku通用属性，true或false");

                    b.Property<int>("is_delete")
                        .HasColumnType("int");

                    b.Property<string>("name")
                        .HasColumnType("longtext")
                        .HasComment("参数名");

                    b.Property<int>("numeric")
                        .HasColumnType("int")
                        .HasComment("是否是数字类型参数，true或false");

                    b.Property<int>("searching")
                        .HasColumnType("int")
                        .HasComment("是否用于搜索过滤，true或false");

                    b.Property<string>("segments")
                        .HasColumnType("longtext")
                        .HasComment("数值类型参数，如果需要搜索，则添加分段间隔值，如CPU频率间隔：0.5-1.0");

                    b.Property<int?>("spec_Groupid")
                        .HasColumnType("int");

                    b.Property<string>("unit")
                        .HasColumnType("longtext")
                        .HasComment("数字类型参数的单位，非数字类型可以为空");

                    b.HasKey("id");

                    b.HasIndex("categoryid");

                    b.HasIndex("spec_Groupid");

                    b.ToTable("spec_param");
                });

            modelBuilder.Entity("Yi.Framework.Model.Models.spu", b =>
                {
                    b.Property<int>("id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int?>("brandid")
                        .HasColumnType("int");

                    b.Property<DateTime>("crate_time")
                        .HasColumnType("datetime(6)")
                        .HasComment("创建时间");

                    b.Property<int>("is_delete")
                        .HasColumnType("int");

                    b.Property<DateTime>("last_update_time")
                        .HasColumnType("datetime(6)")
                        .HasComment("最后更新时间");

                    b.Property<int>("saleable")
                        .HasColumnType("int")
                        .HasComment("是否上架");

                    b.Property<int?>("spu_Detailid")
                        .HasColumnType("int");

                    b.Property<string>("sub_title")
                        .HasColumnType("longtext")
                        .HasComment("子标题");

                    b.Property<string>("title")
                        .HasColumnType("longtext")
                        .HasComment("标题");

                    b.Property<int>("valid")
                        .HasColumnType("int")
                        .HasComment("是否有效");

                    b.HasKey("id");

                    b.HasIndex("brandid");

                    b.HasIndex("spu_Detailid");

                    b.ToTable("spu");
                });

            modelBuilder.Entity("Yi.Framework.Model.Models.spu_detail", b =>
                {
                    b.Property<int>("id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("after_service")
                        .HasColumnType("longtext")
                        .HasComment("售后服务");

                    b.Property<string>("description")
                        .HasColumnType("longtext")
                        .HasComment("描述");

                    b.Property<string>("generic_spec")
                        .HasColumnType("longtext")
                        .HasComment("通用规格参数数据");

                    b.Property<int>("is_delete")
                        .HasColumnType("int");

                    b.Property<string>("packing_list")
                        .HasColumnType("longtext")
                        .HasComment("包装清单");

                    b.Property<string>("special_spec")
                        .HasColumnType("longtext")
                        .HasComment("特有规格参数及可选值信息，json格式");

                    b.HasKey("id");

                    b.ToTable("spu_detail");
                });

            modelBuilder.Entity("Yi.Framework.Model.Models.stock", b =>
                {
                    b.Property<int>("id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int>("is_delete")
                        .HasColumnType("int");

                    b.Property<int>("seckill_stock")
                        .HasColumnType("int")
                        .HasComment("可秒杀库存");

                    b.Property<int>("seckill_total")
                        .HasColumnType("int")
                        .HasComment("秒杀总数量");

                    b.Property<int?>("skuid")
                        .HasColumnType("int");

                    b.Property<int>("stock_count")
                        .HasColumnType("int")
                        .HasComment("库存数量");

                    b.HasKey("id");

                    b.HasIndex("skuid");

                    b.ToTable("stock");
                });

            modelBuilder.Entity("Yi.Framework.Model.Models.user", b =>
                {
                    b.Property<int>("id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("address")
                        .HasColumnType("longtext");

                    b.Property<int?>("age")
                        .HasColumnType("int");

                    b.Property<string>("email")
                        .HasColumnType("longtext");

                    b.Property<string>("icon")
                        .HasColumnType("longtext");

                    b.Property<string>("introduction")
                        .HasColumnType("longtext");

                    b.Property<string>("ip")
                        .HasColumnType("longtext");

                    b.Property<int>("is_delete")
                        .HasColumnType("int");

                    b.Property<string>("nick")
                        .HasColumnType("longtext");

                    b.Property<string>("password")
                        .HasColumnType("longtext");

                    b.Property<string>("phone")
                        .HasColumnType("longtext");

                    b.Property<string>("username")
                        .HasColumnType("longtext");

                    b.HasKey("id");

                    b.ToTable("user");
                });

            modelBuilder.Entity("Yi.Framework.Model.Models.visit", b =>
                {
                    b.Property<int>("id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int>("is_delete")
                        .HasColumnType("int");

                    b.Property<int>("num")
                        .HasColumnType("int");

                    b.Property<DateTime>("time")
                        .HasColumnType("datetime(6)");

                    b.HasKey("id");

                    b.ToTable("visit");
                });

            modelBuilder.Entity("brandcategory", b =>
                {
                    b.Property<int>("brandsid")
                        .HasColumnType("int");

                    b.Property<int>("categoriesid")
                        .HasColumnType("int");

                    b.HasKey("brandsid", "categoriesid");

                    b.HasIndex("categoriesid");

                    b.ToTable("brandcategory");
                });

            modelBuilder.Entity("categoryspu", b =>
                {
                    b.Property<int>("categoriesid")
                        .HasColumnType("int");

                    b.Property<int>("spusid")
                        .HasColumnType("int");

                    b.HasKey("categoriesid", "spusid");

                    b.HasIndex("spusid");

                    b.ToTable("categoryspu");
                });

            modelBuilder.Entity("menurole", b =>
                {
                    b.Property<int>("menusid")
                        .HasColumnType("int");

                    b.Property<int>("rolesid")
                        .HasColumnType("int");

                    b.HasKey("menusid", "rolesid");

                    b.HasIndex("rolesid");

                    b.ToTable("menurole");
                });

            modelBuilder.Entity("roleuser", b =>
                {
                    b.Property<int>("rolesid")
                        .HasColumnType("int");

                    b.Property<int>("usersid")
                        .HasColumnType("int");

                    b.HasKey("rolesid", "usersid");

                    b.HasIndex("usersid");

                    b.ToTable("roleuser");
                });

            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.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.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("brandcategory", b =>
                {
                    b.HasOne("Yi.Framework.Model.Models.brand", null)
                        .WithMany()
                        .HasForeignKey("brandsid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Yi.Framework.Model.Models.category", null)
                        .WithMany()
                        .HasForeignKey("categoriesid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            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("menurole", b =>
                {
                    b.HasOne("Yi.Framework.Model.Models.menu", null)
                        .WithMany()
                        .HasForeignKey("menusid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Yi.Framework.Model.Models.role", null)
                        .WithMany()
                        .HasForeignKey("rolesid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("roleuser", b =>
                {
                    b.HasOne("Yi.Framework.Model.Models.role", null)
                        .WithMany()
                        .HasForeignKey("rolesid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Yi.Framework.Model.Models.user", null)
                        .WithMany()
                        .HasForeignKey("usersid")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Yi.Framework.Model.Models.brand", b =>
                {
                    b.Navigation("spus");
                });

            modelBuilder.Entity("Yi.Framework.Model.Models.category", b =>
                {
                    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.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");
                });
#pragma warning restore 612, 618
        }
    }
}
