//
using System;
using IoTGateway.DataAccess;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20221107035009_Init")]
partial class Init
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("ActionName")
.HasMaxLength(255)
.HasColumnType("varchar(255)");
b.Property("ActionTime")
.HasColumnType("datetime(6)");
b.Property("ActionUrl")
.HasMaxLength(250)
.HasColumnType("varchar(250)");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("CreateTime")
.HasColumnType("datetime(6)");
b.Property("Duration")
.HasColumnType("double");
b.Property("IP")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("ITCode")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("LogType")
.HasColumnType("int");
b.Property("ModuleName")
.HasMaxLength(255)
.HasColumnType("varchar(255)");
b.Property("Remark")
.HasColumnType("longtext");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("CreateTime")
.HasColumnType("datetime(6)");
b.Property("Domain")
.HasColumnType("longtext");
b.Property("GroupCode")
.HasColumnType("longtext");
b.Property("RelateId")
.HasColumnType("longtext");
b.Property("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("UpdateTime")
.HasColumnType("datetime(6)");
b.Property("UserCode")
.HasColumnType("longtext");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("ExtraInfo")
.HasColumnType("longtext");
b.Property("FileData")
.HasColumnType("longblob");
b.Property("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("varchar(10)");
b.Property("FileName")
.IsRequired()
.HasColumnType("longtext");
b.Property("HandlerInfo")
.HasColumnType("longtext");
b.Property("Length")
.HasColumnType("bigint");
b.Property("Path")
.HasColumnType("longtext");
b.Property("SaveMode")
.HasColumnType("longtext");
b.Property("UploadTime")
.HasColumnType("datetime(6)");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("CreateTime")
.HasColumnType("datetime(6)");
b.Property("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("GroupRemark")
.HasColumnType("longtext");
b.Property("TenantCode")
.HasColumnType("longtext");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("ActionName")
.HasColumnType("longtext");
b.Property("ClassName")
.HasColumnType("longtext");
b.Property("DisplayOrder")
.IsRequired()
.HasColumnType("int");
b.Property("Domain")
.HasColumnType("longtext");
b.Property("FolderOnly")
.HasColumnType("tinyint(1)");
b.Property("Icon")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("IsInherit")
.HasColumnType("tinyint(1)");
b.Property("IsInside")
.IsRequired()
.HasColumnType("tinyint(1)");
b.Property("IsPublic")
.HasColumnType("tinyint(1)");
b.Property("MethodName")
.HasColumnType("longtext");
b.Property("ModuleName")
.HasColumnType("longtext");
b.Property("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("ParentId")
.HasColumnType("char(36)");
b.Property("ShowOnMenu")
.HasColumnType("tinyint(1)");
b.Property("Url")
.HasColumnType("longtext");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("CreateTime")
.HasColumnType("datetime(6)");
b.Property("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("varchar(100)");
b.Property("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("RoleRemark")
.HasColumnType("longtext");
b.Property("TenantCode")
.HasColumnType("longtext");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("Address")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property("CellPhone")
.HasColumnType("longtext");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("CreateTime")
.HasColumnType("datetime(6)");
b.Property("Email")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("Gender")
.HasColumnType("int");
b.Property("HomePhone")
.HasMaxLength(30)
.HasColumnType("varchar(30)");
b.Property("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("IsValid")
.HasColumnType("tinyint(1)");
b.Property("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("varchar(32)");
b.Property("PhotoId")
.HasColumnType("char(36)");
b.Property("TenantCode")
.HasColumnType("longtext");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("UpdateTime")
.HasColumnType("datetime(6)");
b.Property("ZipCode")
.HasColumnType("longtext");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("CreateTime")
.HasColumnType("datetime(6)");
b.Property("GroupCode")
.IsRequired()
.HasColumnType("longtext");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("UpdateTime")
.HasColumnType("datetime(6)");
b.Property("UserCode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("CreateTime")
.HasColumnType("datetime(6)");
b.Property("RoleCode")
.IsRequired()
.HasColumnType("longtext");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("UpdateTime")
.HasColumnType("datetime(6)");
b.Property("UserCode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("Allowed")
.IsRequired()
.HasColumnType("tinyint(1)");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("CreateTime")
.HasColumnType("datetime(6)");
b.Property("MenuItemId")
.HasColumnType("char(36)");
b.Property("RoleCode")
.HasColumnType("longtext");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property("CreationTime")
.HasColumnType("datetime(6)");
b.Property("Expiration")
.HasColumnType("datetime(6)");
b.Property("RefreshToken")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("Type")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property("UserCode")
.HasColumnType("longtext");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Parent");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FileAttachment", "Photo")
.WithMany()
.HasForeignKey("PhotoId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Photo");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.HasOne("WalkingTec.Mvvm.Core.FrameworkMenu", "MenuItem")
.WithMany("Privileges")
.HasForeignKey("MenuItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MenuItem");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}