//
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("20240719011950_CommentAndIndex")]
partial class CommentAndIndex
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.10");
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("AutoStart")
.HasColumnType("INTEGER")
.HasComment("启动");
b.Property("CgUpload")
.HasColumnType("INTEGER")
.HasComment("变化上传");
b.Property("CmdPeriod")
.HasColumnType("INTEGER")
.HasComment("指令间隔ms");
b.Property("CreateBy")
.HasColumnType("TEXT");
b.Property("CreateTime")
.HasColumnType("TEXT");
b.Property("Description")
.HasColumnType("TEXT")
.HasComment("描述");
b.Property("DeviceName")
.HasColumnType("TEXT")
.HasComment("名称");
b.Property("DeviceTypeEnum")
.HasColumnType("INTEGER")
.HasComment("类型(组或设备)");
b.Property("DriverId")
.HasColumnType("TEXT")
.HasComment("驱动");
b.Property("EnforcePeriod")
.HasColumnType("INTEGER")
.HasComment("归档周期ms");
b.Property("Index")
.HasColumnType("INTEGER")
.HasComment("排序");
b.Property("ParentId")
.HasColumnType("TEXT");
b.Property("UpdateBy")
.HasColumnType("TEXT");
b.Property("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("AutoStart");
b.HasIndex("DeviceName");
b.HasIndex("DeviceTypeEnum");
b.HasIndex("DriverId");
b.HasIndex("ParentId");
b.ToTable("Devices");
b.HasComment("设备维护");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("CreateTime")
.HasColumnType("TEXT");
b.Property("DataSide")
.HasColumnType("INTEGER")
.HasComment("属性侧");
b.Property("Description")
.HasColumnType("TEXT")
.HasComment("描述");
b.Property("DeviceConfigName")
.HasColumnType("TEXT")
.HasComment("名称");
b.Property("DeviceId")
.HasColumnType("TEXT")
.HasComment("所属设备");
b.Property("EnumInfo")
.HasColumnType("TEXT")
.HasComment("备注");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("UpdateTime")
.HasColumnType("TEXT");
b.Property("Value")
.HasColumnType("TEXT")
.HasComment("值");
b.HasKey("ID");
b.HasIndex("DeviceConfigName");
b.HasIndex("DeviceId");
b.HasIndex("Value");
b.ToTable("DeviceConfigs");
b.HasComment("通讯配置");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Alias")
.HasColumnType("TEXT")
.HasComment("别名");
b.Property("DataType")
.HasColumnType("INTEGER")
.HasComment("数据类型");
b.Property("Description")
.HasColumnType("TEXT")
.HasComment("描述");
b.Property("DeviceAddress")
.HasColumnType("TEXT")
.HasComment("地址");
b.Property("DeviceId")
.HasColumnType("TEXT")
.HasComment("所属设备");
b.Property("EndianType")
.HasColumnType("INTEGER")
.HasComment("大小端");
b.Property("Expressions")
.HasColumnType("TEXT")
.HasComment("表达式");
b.Property("Index")
.HasColumnType("INTEGER")
.HasComment("排序");
b.Property("IsTrigger")
.HasColumnType("INTEGER")
.HasComment("触发");
b.Property("IsUpload")
.HasColumnType("INTEGER")
.HasComment("上传");
b.Property("Method")
.HasColumnType("TEXT")
.HasComment("方法");
b.Property("Name")
.HasColumnType("TEXT")
.HasComment("变量名");
b.Property("ProtectType")
.HasColumnType("INTEGER")
.HasComment("权限");
b.HasKey("ID");
b.HasIndex("DataType");
b.HasIndex("DeviceAddress");
b.HasIndex("DeviceId");
b.HasIndex("Method");
b.HasIndex("Name");
b.ToTable("DeviceVariables");
b.HasComment("变量配置");
});
modelBuilder.Entity("IoTGateway.Model.Driver", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("AssembleName")
.HasColumnType("TEXT")
.HasComment("程序集名");
b.Property("AuthorizesNum")
.HasColumnType("INTEGER")
.HasComment("剩余授权数");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("CreateTime")
.HasColumnType("TEXT");
b.Property("DriverName")
.HasColumnType("TEXT")
.HasComment("驱动名");
b.Property("FileName")
.HasColumnType("TEXT")
.HasComment("文件名");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Drivers");
b.HasComment("驱动管理");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Description")
.HasColumnType("TEXT")
.HasComment("描述");
b.Property("DeviceId")
.HasColumnType("TEXT")
.HasComment("所属设备");
b.Property("EndTime")
.HasColumnType("TEXT")
.HasComment("结束时间");
b.Property("IsSuccess")
.HasColumnType("INTEGER")
.HasComment("是否成功");
b.Property("Method")
.HasColumnType("TEXT")
.HasComment("方法");
b.Property("Params")
.HasColumnType("TEXT")
.HasComment("请求参数");
b.Property("RpcSide")
.HasColumnType("INTEGER")
.HasComment("发起方");
b.Property("StartTime")
.HasColumnType("TEXT")
.HasComment("开始时间");
b.HasKey("ID");
b.HasIndex("DeviceId");
b.ToTable("RpcLogs");
b.HasComment("RPC日志");
});
modelBuilder.Entity("IoTGateway.Model.SystemConfig", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("ClientId")
.HasColumnType("TEXT")
.HasComment("ClientId");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("CreateTime")
.HasColumnType("TEXT");
b.Property("GatewayName")
.HasColumnType("TEXT")
.HasComment("网关名称");
b.Property("IoTPlatformType")
.HasColumnType("INTEGER")
.HasComment("输出平台");
b.Property("MqttIp")
.HasColumnType("TEXT")
.HasComment("Mqtt服务器");
b.Property("MqttPort")
.HasColumnType("INTEGER")
.HasComment("Mqtt端口");
b.Property("MqttUName")
.HasColumnType("TEXT")
.HasComment("Mqtt用户名");
b.Property("MqttUPwd")
.HasColumnType("TEXT")
.HasComment("Mqtt密码");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SystemConfig");
b.HasComment("传输配置");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.ActionLog", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("ActionName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property("ActionTime")
.HasColumnType("TEXT");
b.Property("ActionUrl")
.HasMaxLength(250)
.HasColumnType("TEXT");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("CreateTime")
.HasColumnType("TEXT");
b.Property("Duration")
.HasColumnType("REAL");
b.Property("IP")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("ITCode")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("LogType")
.HasColumnType("INTEGER");
b.Property("ModuleName")
.HasMaxLength(255)
.HasColumnType("TEXT");
b.Property("Remark")
.HasColumnType("TEXT");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("ActionLogs");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.DataPrivilege", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("CreateTime")
.HasColumnType("TEXT");
b.Property("Domain")
.HasColumnType("TEXT");
b.Property("GroupCode")
.HasColumnType("TEXT");
b.Property("RelateId")
.HasColumnType("TEXT");
b.Property("TableName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("UpdateTime")
.HasColumnType("TEXT");
b.Property("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("DataPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FileAttachment", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("ExtraInfo")
.HasColumnType("TEXT");
b.Property("FileData")
.HasColumnType("BLOB");
b.Property("FileExt")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property("FileName")
.IsRequired()
.HasColumnType("TEXT");
b.Property("HandlerInfo")
.HasColumnType("TEXT");
b.Property("Length")
.HasColumnType("INTEGER");
b.Property("Path")
.HasColumnType("TEXT");
b.Property("SaveMode")
.HasColumnType("TEXT");
b.Property("UploadTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FileAttachments");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkGroup", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("CreateTime")
.HasColumnType("TEXT");
b.Property("GroupCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("GroupName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("GroupRemark")
.HasColumnType("TEXT");
b.Property("TenantCode")
.HasColumnType("TEXT");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("ActionName")
.HasColumnType("TEXT");
b.Property("ClassName")
.HasColumnType("TEXT");
b.Property("DisplayOrder")
.IsRequired()
.HasColumnType("INTEGER");
b.Property("Domain")
.HasColumnType("TEXT");
b.Property("FolderOnly")
.HasColumnType("INTEGER");
b.Property("Icon")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("IsInherit")
.HasColumnType("INTEGER");
b.Property("IsInside")
.IsRequired()
.HasColumnType("INTEGER");
b.Property("IsPublic")
.HasColumnType("INTEGER");
b.Property("MethodName")
.HasColumnType("TEXT");
b.Property("ModuleName")
.HasColumnType("TEXT");
b.Property("PageName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("ParentId")
.HasColumnType("TEXT");
b.Property("ShowOnMenu")
.HasColumnType("INTEGER");
b.Property("Url")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("ParentId");
b.ToTable("FrameworkMenus");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkRole", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("CreateTime")
.HasColumnType("TEXT");
b.Property("RoleCode")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("RoleName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("RoleRemark")
.HasColumnType("TEXT");
b.Property("TenantCode")
.HasColumnType("TEXT");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUser", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Address")
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property("CellPhone")
.HasColumnType("TEXT");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("CreateTime")
.HasColumnType("TEXT");
b.Property("Email")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("Gender")
.HasColumnType("INTEGER");
b.Property("HomePhone")
.HasMaxLength(30)
.HasColumnType("TEXT");
b.Property("ITCode")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("IsValid")
.HasColumnType("INTEGER");
b.Property("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("Password")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("TEXT");
b.Property("PhotoId")
.HasColumnType("TEXT");
b.Property("TenantCode")
.HasColumnType("TEXT");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("UpdateTime")
.HasColumnType("TEXT");
b.Property("ZipCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("PhotoId");
b.ToTable("FrameworkUsers");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserGroup", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("CreateTime")
.HasColumnType("TEXT");
b.Property("GroupCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("UpdateTime")
.HasColumnType("TEXT");
b.Property("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserGroups");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkUserRole", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("CreateTime")
.HasColumnType("TEXT");
b.Property("RoleCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("UpdateTime")
.HasColumnType("TEXT");
b.Property("UserCode")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("FrameworkUserRoles");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FunctionPrivilege", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Allowed")
.IsRequired()
.HasColumnType("INTEGER");
b.Property("CreateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("CreateTime")
.HasColumnType("TEXT");
b.Property("MenuItemId")
.HasColumnType("TEXT");
b.Property("RoleCode")
.HasColumnType("TEXT");
b.Property("UpdateBy")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("UpdateTime")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("MenuItemId");
b.ToTable("FunctionPrivileges");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.PersistedGrant", b =>
{
b.Property("ID")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreationTime")
.HasColumnType("TEXT");
b.Property("Expiration")
.HasColumnType("TEXT");
b.Property("RefreshToken")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("Type")
.HasMaxLength(50)
.HasColumnType("TEXT");
b.Property("UserCode")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("PersistedGrants");
});
modelBuilder.Entity("IoTGateway.Model.Device", b =>
{
b.HasOne("IoTGateway.Model.Driver", "Driver")
.WithMany()
.HasForeignKey("DriverId");
b.HasOne("IoTGateway.Model.Device", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
b.Navigation("Driver");
b.Navigation("Parent");
});
modelBuilder.Entity("IoTGateway.Model.DeviceConfig", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceConfigs")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.DeviceVariable", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany("DeviceVariables")
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
modelBuilder.Entity("IoTGateway.Model.RpcLog", b =>
{
b.HasOne("IoTGateway.Model.Device", "Device")
.WithMany()
.HasForeignKey("DeviceId");
b.Navigation("Device");
});
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("IoTGateway.Model.Device", b =>
{
b.Navigation("Children");
b.Navigation("DeviceConfigs");
b.Navigation("DeviceVariables");
});
modelBuilder.Entity("WalkingTec.Mvvm.Core.FrameworkMenu", b =>
{
b.Navigation("Children");
b.Navigation("Privileges");
});
#pragma warning restore 612, 618
}
}
}