首次提交:本地项目同步到Gitea

This commit is contained in:
zhusenlin
2026-03-02 09:08:20 +08:00
commit 1fb681fb34
371 changed files with 31868 additions and 0 deletions

View File

@@ -0,0 +1,464 @@
// <auto-generated />
using System;
using Cowain.TestProject.DBContext;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Cowain.TestProject.Migrations
{
[DbContext(typeof(DBContextGenerator))]
[Migration("20260122065225_init")]
partial class init
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("Cowain.Base.Models.Admins.UserDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("Sex")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("UserNumber")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("user");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 22, 14, 52, 24, 945, DateTimeKind.Local).AddTicks(547),
IsValid = true,
Name = "admin",
Password = "F44DDAC49CE7A95D",
Phone = "17625760609",
RoleId = 1,
Sex = "Male",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
UserNumber = "CWA4483"
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("user_role");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 22, 14, 52, 24, 949, DateTimeKind.Local).AddTicks(9102),
IsValid = true,
RoleName = "管理员",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleMenuDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("MenuActions")
.HasColumnType("longtext");
b.Property<string>("MenuKey")
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("user_role_menu");
b.HasData(
new
{
Id = 1,
MenuActions = "[]",
MenuKey = "Home",
RoleId = 1
},
new
{
Id = 2,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserRoleSetting",
RoleId = 1
},
new
{
Id = 3,
MenuActions = "[ \"edit\", \"delete\"]",
MenuKey = "RoleMenuSetting",
RoleId = 1
},
new
{
Id = 4,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserManagement",
RoleId = 1
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmGroupDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_group");
b.HasData(
new
{
Id = 1,
Name = "系统"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Group")
.HasColumnType("int");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<DateTime>("StartTime")
.HasColumnType("datetime(6)");
b.Property<bool>("Status")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("StopTime")
.HasColumnType("datetime(6)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("alarm_history");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmLevelDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Color")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_level");
b.HasData(
new
{
Id = 1,
Color = "Red",
Name = "报警"
},
new
{
Id = 2,
Color = "Yellow",
Name = "警告"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.DeviceDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("Desc")
.HasColumnType("longtext");
b.Property<string>("DeviceName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("DeviceType")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<string>("DriverName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("Enable")
.HasColumnType("tinyint(1)");
b.Property<string>("Param")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("device");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.TagAddressDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Address")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("AlarmEnable")
.HasColumnType("tinyint(1)");
b.Property<int>("AlarmGroup")
.HasColumnType("int");
b.Property<int>("AlarmLevel")
.HasColumnType("int");
b.Property<string>("AlarmMsg")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("AlarmValue")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("ArrayCount")
.HasColumnType("int");
b.Property<string>("DataType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Json")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("OperMode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("tag_address");
b.HasData(
new
{
Id = 1,
Address = "ns=4;s=L1RSTemp_Output1[0]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag1",
DeviceId = 1,
Json = "",
Name = "Tag1",
OperMode = "Read"
},
new
{
Id = 2,
Address = "ns=4;s=L1RSTemp_Output1[1]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag2",
DeviceId = 1,
Json = "",
Name = "Tag2",
OperMode = "Read"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.VarActionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ActionName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("ActionValue")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Condition")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Param")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("var_action");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,297 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Cowain.TestProject.Migrations
{
/// <inheritdoc />
public partial class init : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "alarm_group",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_alarm_group", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "alarm_history",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
TagId = table.Column<int>(type: "int", nullable: false),
Desc = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Group = table.Column<int>(type: "int", nullable: false),
Level = table.Column<int>(type: "int", nullable: false),
Status = table.Column<bool>(type: "tinyint(1)", nullable: false),
StartTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
StopTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_alarm_history", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "alarm_level",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Color = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_alarm_level", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "device",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
DeviceName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
DriverName = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
DeviceType = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Param = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Desc = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Enable = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_device", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "tag_address",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
DeviceId = table.Column<int>(type: "int", nullable: false),
Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Address = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Desc = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
DataType = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ArrayCount = table.Column<int>(type: "int", nullable: false),
OperMode = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
AlarmEnable = table.Column<bool>(type: "tinyint(1)", nullable: false),
AlarmValue = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
AlarmGroup = table.Column<int>(type: "int", nullable: false),
AlarmLevel = table.Column<int>(type: "int", nullable: false),
AlarmMsg = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Json = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_tag_address", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "user",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
UserNumber = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Phone = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
RoleId = table.Column<int>(type: "int", nullable: false),
Sex = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Password = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsValid = table.Column<bool>(type: "tinyint(1)", nullable: false),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_user", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "user_role",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
RoleName = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
IsValid = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_user_role", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "user_role_menu",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
RoleId = table.Column<int>(type: "int", nullable: false),
MenuKey = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
MenuActions = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_user_role_menu", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "var_action",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
DeviceId = table.Column<int>(type: "int", nullable: false),
TagId = table.Column<int>(type: "int", nullable: false),
ActionName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Param = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Desc = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ActionValue = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Condition = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_var_action", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "alarm_group",
columns: new[] { "Id", "Name" },
values: new object[] { 1, "系统" });
migrationBuilder.InsertData(
table: "alarm_level",
columns: new[] { "Id", "Color", "Name" },
values: new object[,]
{
{ 1, "Red", "报警" },
{ 2, "Yellow", "警告" }
});
migrationBuilder.InsertData(
table: "tag_address",
columns: new[] { "Id", "Address", "AlarmEnable", "AlarmGroup", "AlarmLevel", "AlarmMsg", "AlarmValue", "ArrayCount", "DataType", "Desc", "DeviceId", "Json", "Name", "OperMode" },
values: new object[,]
{
{ 1, "ns=4;s=L1RSTemp_Output1[0]", false, 0, 0, "", "", 1, "Int16", "Tag1", 1, "", "Tag1", "Read" },
{ 2, "ns=4;s=L1RSTemp_Output1[1]", false, 0, 0, "", "", 1, "Int16", "Tag2", 1, "", "Tag2", "Read" }
});
migrationBuilder.InsertData(
table: "user",
columns: new[] { "Id", "CreateTime", "IsValid", "Name", "Password", "Phone", "RoleId", "Sex", "UpdateTime", "UserNumber" },
values: new object[] { 1, new DateTime(2026, 1, 22, 14, 52, 24, 945, DateTimeKind.Local).AddTicks(547), true, "admin", "F44DDAC49CE7A95D", "17625760609", 1, "Male", new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "CWA4483" });
migrationBuilder.InsertData(
table: "user_role",
columns: new[] { "Id", "CreateTime", "IsValid", "RoleName", "UpdateTime" },
values: new object[] { 1, new DateTime(2026, 1, 22, 14, 52, 24, 949, DateTimeKind.Local).AddTicks(9102), true, "管理员", new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) });
migrationBuilder.InsertData(
table: "user_role_menu",
columns: new[] { "Id", "MenuActions", "MenuKey", "RoleId" },
values: new object[,]
{
{ 1, "[]", "Home", 1 },
{ 2, "[ \"add\", \"edit\", \"delete\"]", "UserRoleSetting", 1 },
{ 3, "[ \"edit\", \"delete\"]", "RoleMenuSetting", 1 },
{ 4, "[ \"add\", \"edit\", \"delete\"]", "UserManagement", 1 }
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "alarm_group");
migrationBuilder.DropTable(
name: "alarm_history");
migrationBuilder.DropTable(
name: "alarm_level");
migrationBuilder.DropTable(
name: "device");
migrationBuilder.DropTable(
name: "tag_address");
migrationBuilder.DropTable(
name: "user");
migrationBuilder.DropTable(
name: "user_role");
migrationBuilder.DropTable(
name: "user_role_menu");
migrationBuilder.DropTable(
name: "var_action");
}
}
}

View File

@@ -0,0 +1,621 @@
// <auto-generated />
using System;
using Cowain.TestProject.DBContext;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Cowain.TestProject.Migrations
{
[DbContext(typeof(DBContextGenerator))]
[Migration("20260124082311_baking_model")]
partial class baking_model
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("Cowain.Base.Models.Admins.UserDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("Sex")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("UserNumber")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("user");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 24, 16, 23, 11, 270, DateTimeKind.Local).AddTicks(5712),
IsValid = true,
Name = "admin",
Password = "F44DDAC49CE7A95D",
Phone = "17625760609",
RoleId = 1,
Sex = "Male",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
UserNumber = "CWA4483"
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("user_role");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 24, 16, 23, 11, 280, DateTimeKind.Local).AddTicks(5323),
IsValid = true,
RoleName = "管理员",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleMenuDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("MenuActions")
.HasColumnType("longtext");
b.Property<string>("MenuKey")
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("user_role_menu");
b.HasData(
new
{
Id = 1,
MenuActions = "[]",
MenuKey = "Home",
RoleId = 1
},
new
{
Id = 2,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserRoleSetting",
RoleId = 1
},
new
{
Id = 3,
MenuActions = "[ \"edit\", \"delete\"]",
MenuKey = "RoleMenuSetting",
RoleId = 1
},
new
{
Id = 4,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserManagement",
RoleId = 1
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BatteryInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("IsWaterBattery")
.HasColumnType("tinyint(1)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.Property<DateTime?>("ScanTime")
.HasColumnType("datetime(6)");
b.Property<int>("Status")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("battery_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletStatus")
.HasColumnType("int");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<double>("WaterValue")
.HasColumnType("double");
b.HasKey("Id");
b.ToTable("pallet_info");
b.UseTptMappingStrategy();
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletStatusDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_status");
b.HasData(
new
{
Id = 1,
Desc = "新托盘",
Name = "New"
},
new
{
Id = 2,
Desc = "上料中",
Name = "Loading"
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.StationInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("LayOutX")
.HasColumnType("int");
b.Property<int>("LayOutY")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("station_info");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmGroupDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_group");
b.HasData(
new
{
Id = 1,
Name = "系统"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Group")
.HasColumnType("int");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<DateTime>("StartTime")
.HasColumnType("datetime(6)");
b.Property<bool>("Status")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("StopTime")
.HasColumnType("datetime(6)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("alarm_history");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmLevelDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Color")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_level");
b.HasData(
new
{
Id = 1,
Color = "Red",
Name = "报警"
},
new
{
Id = 2,
Color = "Yellow",
Name = "警告"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.DeviceDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("Desc")
.HasColumnType("longtext");
b.Property<string>("DeviceName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("DeviceType")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<string>("DriverName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("Enable")
.HasColumnType("tinyint(1)");
b.Property<string>("Param")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("device");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.TagAddressDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Address")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("AlarmEnable")
.HasColumnType("tinyint(1)");
b.Property<int>("AlarmGroup")
.HasColumnType("int");
b.Property<int>("AlarmLevel")
.HasColumnType("int");
b.Property<string>("AlarmMsg")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("AlarmValue")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("ArrayCount")
.HasColumnType("int");
b.Property<string>("DataType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Json")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("OperMode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("tag_address");
b.HasData(
new
{
Id = 1,
Address = "ns=4;s=L1RSTemp_Output1[0]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag1",
DeviceId = 1,
Json = "",
Name = "Tag1",
OperMode = "Read"
},
new
{
Id = 2,
Address = "ns=4;s=L1RSTemp_Output1[1]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag2",
DeviceId = 1,
Json = "",
Name = "Tag2",
OperMode = "Read"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.VarActionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ActionName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("ActionValue")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Condition")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Param")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("var_action");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoHistoryDto", b =>
{
b.HasBaseType("Plugin.Cowain.Baking.Models.Dto.PalletInfoDto");
b.ToTable("pallet_info_history");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoHistoryDto", b =>
{
b.HasOne("Plugin.Cowain.Baking.Models.Dto.PalletInfoDto", null)
.WithOne()
.HasForeignKey("Plugin.Cowain.Baking.Models.Dto.PalletInfoHistoryDto", "Id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,170 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Cowain.TestProject.Migrations
{
/// <inheritdoc />
public partial class baking_model : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "battery_info",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Code = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
PalletId = table.Column<int>(type: "int", nullable: false),
IsWaterBattery = table.Column<bool>(type: "tinyint(1)", nullable: false),
Status = table.Column<int>(type: "int", nullable: false),
ScanTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_battery_info", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "pallet_info",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Code = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
PalletStatus = table.Column<int>(type: "int", nullable: false),
StationId = table.Column<int>(type: "int", nullable: false),
LoadingStartTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LoadingEndTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
BakingStartTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
BakingEndTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UnLoadingTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
UpdateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
WaterValue = table.Column<double>(type: "double", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_pallet_info", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "pallet_status",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Desc = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_pallet_status", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "station_info",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
LayOutX = table.Column<int>(type: "int", nullable: false),
LayOutY = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_station_info", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "pallet_info_history",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_pallet_info_history", x => x.Id);
table.ForeignKey(
name: "FK_pallet_info_history_pallet_info_Id",
column: x => x.Id,
principalTable: "pallet_info",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "pallet_status",
columns: new[] { "Id", "Desc", "Name" },
values: new object[,]
{
{ 1, "新托盘", "New" },
{ 2, "上料中", "Loading" }
});
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 24, 16, 23, 11, 270, DateTimeKind.Local).AddTicks(5712));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 24, 16, 23, 11, 280, DateTimeKind.Local).AddTicks(5323));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "battery_info");
migrationBuilder.DropTable(
name: "pallet_info_history");
migrationBuilder.DropTable(
name: "pallet_status");
migrationBuilder.DropTable(
name: "station_info");
migrationBuilder.DropTable(
name: "pallet_info");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 22, 14, 52, 24, 945, DateTimeKind.Local).AddTicks(547));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 22, 14, 52, 24, 949, DateTimeKind.Local).AddTicks(9102));
}
}
}

View File

@@ -0,0 +1,717 @@
// <auto-generated />
using System;
using Cowain.TestProject.DBContext;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Cowain.TestProject.Migrations
{
[DbContext(typeof(DBContextGenerator))]
[Migration("20260126032551_baking_model_edit")]
partial class baking_model_edit
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("Cowain.Base.Models.Admins.UserDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("Sex")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("UserNumber")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("user");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 26, 11, 25, 51, 148, DateTimeKind.Local).AddTicks(7643),
IsValid = true,
Name = "admin",
Password = "F44DDAC49CE7A95D",
Phone = "17625760609",
RoleId = 1,
Sex = "Male",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
UserNumber = "CWA4483"
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("user_role");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 26, 11, 25, 51, 165, DateTimeKind.Local).AddTicks(2827),
IsValid = true,
RoleName = "管理员",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleMenuDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("MenuActions")
.HasColumnType("longtext");
b.Property<string>("MenuKey")
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("user_role_menu");
b.HasData(
new
{
Id = 1,
MenuActions = "[]",
MenuKey = "Home",
RoleId = 1
},
new
{
Id = 2,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserRoleSetting",
RoleId = 1
},
new
{
Id = 3,
MenuActions = "[ \"edit\", \"delete\"]",
MenuKey = "RoleMenuSetting",
RoleId = 1
},
new
{
Id = 4,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserManagement",
RoleId = 1
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("DataValue")
.HasColumnType("longtext");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingVariableDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_variable");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BatteryInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("IsWaterBattery")
.HasColumnType("tinyint(1)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.Property<DateTime?>("ScanTime")
.HasColumnType("datetime(6)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<double>("WaterValue")
.HasColumnType("double");
b.HasKey("Id");
b.ToTable("battery_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletBindingDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("pallet_binding");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletStatus")
.HasColumnType("int");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<double>("WaterValue")
.HasColumnType("double");
b.HasKey("Id");
b.ToTable("pallet_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime>("HistoryTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletStatus")
.HasColumnType("int");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<double>("WaterValue")
.HasColumnType("double");
b.HasKey("Id");
b.ToTable("pallet_info_history");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletStatusDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_status");
b.HasData(
new
{
Id = 1,
Desc = "新托盘",
Name = "New"
},
new
{
Id = 2,
Desc = "上料中",
Name = "Loading"
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.StationInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("LayOutX")
.HasColumnType("int");
b.Property<int>("LayOutY")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("station_info");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmGroupDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_group");
b.HasData(
new
{
Id = 1,
Name = "系统"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Group")
.HasColumnType("int");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<DateTime>("StartTime")
.HasColumnType("datetime(6)");
b.Property<bool>("Status")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("StopTime")
.HasColumnType("datetime(6)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("alarm_history");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmLevelDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Color")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_level");
b.HasData(
new
{
Id = 1,
Color = "Red",
Name = "报警"
},
new
{
Id = 2,
Color = "Yellow",
Name = "警告"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.DeviceDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("Desc")
.HasColumnType("longtext");
b.Property<string>("DeviceName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("DeviceType")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<string>("DriverName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("Enable")
.HasColumnType("tinyint(1)");
b.Property<string>("Param")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("device");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.TagAddressDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Address")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("AlarmEnable")
.HasColumnType("tinyint(1)");
b.Property<int>("AlarmGroup")
.HasColumnType("int");
b.Property<int>("AlarmLevel")
.HasColumnType("int");
b.Property<string>("AlarmMsg")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("AlarmValue")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("ArrayCount")
.HasColumnType("int");
b.Property<string>("DataType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Json")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("OperMode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("tag_address");
b.HasData(
new
{
Id = 1,
Address = "ns=4;s=L1RSTemp_Output1[0]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag1",
DeviceId = 1,
Json = "",
Name = "Tag1",
OperMode = "Read"
},
new
{
Id = 2,
Address = "ns=4;s=L1RSTemp_Output1[1]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag2",
DeviceId = 1,
Json = "",
Name = "Tag2",
OperMode = "Read"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.VarActionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ActionName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("ActionValue")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Condition")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Param")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("var_action");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,284 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Cowain.TestProject.Migrations
{
/// <inheritdoc />
public partial class baking_model_edit : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_pallet_info_history_pallet_info_Id",
table: "pallet_info_history");
migrationBuilder.DropColumn(
name: "CreateTime",
table: "pallet_info");
migrationBuilder.AlterColumn<int>(
name: "Id",
table: "pallet_info_history",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AddColumn<DateTime>(
name: "BakingEndTime",
table: "pallet_info_history",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "BakingStartTime",
table: "pallet_info_history",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Code",
table: "pallet_info_history",
type: "varchar(200)",
maxLength: 200,
nullable: false,
defaultValue: "")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<DateTime>(
name: "HistoryTime",
table: "pallet_info_history",
type: "datetime(6)",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "LoadingEndTime",
table: "pallet_info_history",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "LoadingStartTime",
table: "pallet_info_history",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "PalletStatus",
table: "pallet_info_history",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "StationId",
table: "pallet_info_history",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<DateTime>(
name: "UnLoadingTime",
table: "pallet_info_history",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "UpdateTime",
table: "pallet_info_history",
type: "datetime(6)",
nullable: true);
migrationBuilder.AddColumn<double>(
name: "WaterValue",
table: "pallet_info_history",
type: "double",
nullable: false,
defaultValue: 0.0);
migrationBuilder.AddColumn<int>(
name: "BindingId",
table: "pallet_info",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<double>(
name: "WaterValue",
table: "battery_info",
type: "double",
nullable: false,
defaultValue: 0.0);
migrationBuilder.CreateTable(
name: "baking_info",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
BindingId = table.Column<int>(type: "int", nullable: false),
TagId = table.Column<int>(type: "int", nullable: false),
DataValue = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_baking_info", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "baking_variable",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
StationId = table.Column<int>(type: "int", nullable: false),
TagId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_baking_variable", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "pallet_binding",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
PalletId = table.Column<int>(type: "int", nullable: false),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_pallet_binding", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 11, 25, 51, 148, DateTimeKind.Local).AddTicks(7643));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 11, 25, 51, 165, DateTimeKind.Local).AddTicks(2827));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "baking_info");
migrationBuilder.DropTable(
name: "baking_variable");
migrationBuilder.DropTable(
name: "pallet_binding");
migrationBuilder.DropColumn(
name: "BakingEndTime",
table: "pallet_info_history");
migrationBuilder.DropColumn(
name: "BakingStartTime",
table: "pallet_info_history");
migrationBuilder.DropColumn(
name: "Code",
table: "pallet_info_history");
migrationBuilder.DropColumn(
name: "HistoryTime",
table: "pallet_info_history");
migrationBuilder.DropColumn(
name: "LoadingEndTime",
table: "pallet_info_history");
migrationBuilder.DropColumn(
name: "LoadingStartTime",
table: "pallet_info_history");
migrationBuilder.DropColumn(
name: "PalletStatus",
table: "pallet_info_history");
migrationBuilder.DropColumn(
name: "StationId",
table: "pallet_info_history");
migrationBuilder.DropColumn(
name: "UnLoadingTime",
table: "pallet_info_history");
migrationBuilder.DropColumn(
name: "UpdateTime",
table: "pallet_info_history");
migrationBuilder.DropColumn(
name: "WaterValue",
table: "pallet_info_history");
migrationBuilder.DropColumn(
name: "BindingId",
table: "pallet_info");
migrationBuilder.DropColumn(
name: "WaterValue",
table: "battery_info");
migrationBuilder.AlterColumn<int>(
name: "Id",
table: "pallet_info_history",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AddColumn<DateTime>(
name: "CreateTime",
table: "pallet_info",
type: "datetime(6)",
nullable: true);
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 24, 16, 23, 11, 270, DateTimeKind.Local).AddTicks(5712));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 24, 16, 23, 11, 280, DateTimeKind.Local).AddTicks(5323));
migrationBuilder.AddForeignKey(
name: "FK_pallet_info_history_pallet_info_Id",
table: "pallet_info_history",
column: "Id",
principalTable: "pallet_info",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@@ -0,0 +1,714 @@
// <auto-generated />
using System;
using Cowain.TestProject.DBContext;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Cowain.TestProject.Migrations
{
[DbContext(typeof(DBContextGenerator))]
[Migration("20260126052708_pallet_edit")]
partial class pallet_edit
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("Cowain.Base.Models.Admins.UserDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("Sex")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("UserNumber")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("user");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 26, 13, 27, 8, 455, DateTimeKind.Local).AddTicks(9319),
IsValid = true,
Name = "admin",
Password = "F44DDAC49CE7A95D",
Phone = "17625760609",
RoleId = 1,
Sex = "Male",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
UserNumber = "CWA4483"
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("user_role");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 26, 13, 27, 8, 461, DateTimeKind.Local).AddTicks(1704),
IsValid = true,
RoleName = "管理员",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleMenuDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("MenuActions")
.HasColumnType("longtext");
b.Property<string>("MenuKey")
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("user_role_menu");
b.HasData(
new
{
Id = 1,
MenuActions = "[]",
MenuKey = "Home",
RoleId = 1
},
new
{
Id = 2,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserRoleSetting",
RoleId = 1
},
new
{
Id = 3,
MenuActions = "[ \"edit\", \"delete\"]",
MenuKey = "RoleMenuSetting",
RoleId = 1
},
new
{
Id = 4,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserManagement",
RoleId = 1
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("DataValue")
.HasColumnType("longtext");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingVariableDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_variable");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BatteryInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("IsWaterBattery")
.HasColumnType("tinyint(1)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.Property<DateTime?>("ScanTime")
.HasColumnType("datetime(6)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<double>("WaterValue")
.HasColumnType("double");
b.HasKey("Id");
b.ToTable("battery_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletBindingDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("pallet_binding");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletStatus")
.HasColumnType("int");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<double>("WaterValue")
.HasColumnType("double");
b.HasKey("Id");
b.ToTable("pallet_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime>("HistoryTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletStatus")
.HasColumnType("int");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<double>("WaterValue")
.HasColumnType("double");
b.HasKey("Id");
b.ToTable("pallet_info_history");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletStatusDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_status");
b.HasData(
new
{
Id = 1,
Desc = "新托盘",
Name = "New"
},
new
{
Id = 2,
Desc = "上料中",
Name = "Loading"
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.StationInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("LayOutX")
.HasColumnType("int");
b.Property<int>("LayOutY")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("station_info");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmGroupDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_group");
b.HasData(
new
{
Id = 1,
Name = "系统"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Group")
.HasColumnType("int");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<DateTime>("StartTime")
.HasColumnType("datetime(6)");
b.Property<bool>("Status")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("StopTime")
.HasColumnType("datetime(6)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("alarm_history");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmLevelDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Color")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_level");
b.HasData(
new
{
Id = 1,
Color = "Red",
Name = "报警"
},
new
{
Id = 2,
Color = "Yellow",
Name = "警告"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.DeviceDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("Desc")
.HasColumnType("longtext");
b.Property<string>("DeviceName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("DeviceType")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<string>("DriverName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("Enable")
.HasColumnType("tinyint(1)");
b.Property<string>("Param")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("device");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.TagAddressDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Address")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("AlarmEnable")
.HasColumnType("tinyint(1)");
b.Property<int>("AlarmGroup")
.HasColumnType("int");
b.Property<int>("AlarmLevel")
.HasColumnType("int");
b.Property<string>("AlarmMsg")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("AlarmValue")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("ArrayCount")
.HasColumnType("int");
b.Property<string>("DataType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Json")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("OperMode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("tag_address");
b.HasData(
new
{
Id = 1,
Address = "ns=4;s=L1RSTemp_Output1[0]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag1",
DeviceId = 1,
Json = "",
Name = "Tag1",
OperMode = "Read"
},
new
{
Id = 2,
Address = "ns=4;s=L1RSTemp_Output1[1]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag2",
DeviceId = 1,
Json = "",
Name = "Tag2",
OperMode = "Read"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.VarActionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ActionName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("ActionValue")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Condition")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Param")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("var_action");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,57 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Cowain.TestProject.Migrations
{
/// <inheritdoc />
public partial class pallet_edit : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "UpdateTime",
table: "pallet_info_history");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 13, 27, 8, 455, DateTimeKind.Local).AddTicks(9319));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 13, 27, 8, 461, DateTimeKind.Local).AddTicks(1704));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "UpdateTime",
table: "pallet_info_history",
type: "datetime(6)",
nullable: true);
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 11, 25, 51, 148, DateTimeKind.Local).AddTicks(7643));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 11, 25, 51, 165, DateTimeKind.Local).AddTicks(2827));
}
}
}

View File

@@ -0,0 +1,714 @@
// <auto-generated />
using System;
using Cowain.TestProject.DBContext;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Cowain.TestProject.Migrations
{
[DbContext(typeof(DBContextGenerator))]
[Migration("20260126052919_pallet_water_value")]
partial class pallet_water_value
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("Cowain.Base.Models.Admins.UserDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("Sex")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("UserNumber")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("user");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 26, 13, 29, 18, 736, DateTimeKind.Local).AddTicks(5446),
IsValid = true,
Name = "admin",
Password = "F44DDAC49CE7A95D",
Phone = "17625760609",
RoleId = 1,
Sex = "Male",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
UserNumber = "CWA4483"
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("user_role");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 26, 13, 29, 18, 741, DateTimeKind.Local).AddTicks(3327),
IsValid = true,
RoleName = "管理员",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleMenuDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("MenuActions")
.HasColumnType("longtext");
b.Property<string>("MenuKey")
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("user_role_menu");
b.HasData(
new
{
Id = 1,
MenuActions = "[]",
MenuKey = "Home",
RoleId = 1
},
new
{
Id = 2,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserRoleSetting",
RoleId = 1
},
new
{
Id = 3,
MenuActions = "[ \"edit\", \"delete\"]",
MenuKey = "RoleMenuSetting",
RoleId = 1
},
new
{
Id = 4,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserManagement",
RoleId = 1
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("DataValue")
.HasColumnType("longtext");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingVariableDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_variable");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BatteryInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("IsWaterBattery")
.HasColumnType("tinyint(1)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.Property<DateTime?>("ScanTime")
.HasColumnType("datetime(6)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<double>("WaterValue")
.HasColumnType("double");
b.HasKey("Id");
b.ToTable("battery_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletBindingDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("pallet_binding");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletStatus")
.HasColumnType("int");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("pallet_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime>("HistoryTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletStatus")
.HasColumnType("int");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("pallet_info_history");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletStatusDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_status");
b.HasData(
new
{
Id = 1,
Desc = "新托盘",
Name = "New"
},
new
{
Id = 2,
Desc = "上料中",
Name = "Loading"
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.StationInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("LayOutX")
.HasColumnType("int");
b.Property<int>("LayOutY")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("station_info");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmGroupDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_group");
b.HasData(
new
{
Id = 1,
Name = "系统"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Group")
.HasColumnType("int");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<DateTime>("StartTime")
.HasColumnType("datetime(6)");
b.Property<bool>("Status")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("StopTime")
.HasColumnType("datetime(6)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("alarm_history");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmLevelDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Color")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_level");
b.HasData(
new
{
Id = 1,
Color = "Red",
Name = "报警"
},
new
{
Id = 2,
Color = "Yellow",
Name = "警告"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.DeviceDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("Desc")
.HasColumnType("longtext");
b.Property<string>("DeviceName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("DeviceType")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<string>("DriverName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("Enable")
.HasColumnType("tinyint(1)");
b.Property<string>("Param")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("device");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.TagAddressDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Address")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("AlarmEnable")
.HasColumnType("tinyint(1)");
b.Property<int>("AlarmGroup")
.HasColumnType("int");
b.Property<int>("AlarmLevel")
.HasColumnType("int");
b.Property<string>("AlarmMsg")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("AlarmValue")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("ArrayCount")
.HasColumnType("int");
b.Property<string>("DataType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Json")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("OperMode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("tag_address");
b.HasData(
new
{
Id = 1,
Address = "ns=4;s=L1RSTemp_Output1[0]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag1",
DeviceId = 1,
Json = "",
Name = "Tag1",
OperMode = "Read"
},
new
{
Id = 2,
Address = "ns=4;s=L1RSTemp_Output1[1]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag2",
DeviceId = 1,
Json = "",
Name = "Tag2",
OperMode = "Read"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.VarActionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ActionName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("ActionValue")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Condition")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Param")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("var_action");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,87 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Cowain.TestProject.Migrations
{
/// <inheritdoc />
public partial class pallet_water_value : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "WaterValue",
table: "pallet_info_history",
type: "longtext",
nullable: true,
oldClrType: typeof(double),
oldType: "double")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "WaterValue",
table: "pallet_info",
type: "longtext",
nullable: true,
oldClrType: typeof(double),
oldType: "double")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 13, 29, 18, 736, DateTimeKind.Local).AddTicks(5446));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 13, 29, 18, 741, DateTimeKind.Local).AddTicks(3327));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<double>(
name: "WaterValue",
table: "pallet_info_history",
type: "double",
nullable: false,
defaultValue: 0.0,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<double>(
name: "WaterValue",
table: "pallet_info",
type: "double",
nullable: false,
defaultValue: 0.0,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 13, 27, 8, 455, DateTimeKind.Local).AddTicks(9319));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 13, 27, 8, 461, DateTimeKind.Local).AddTicks(1704));
}
}
}

View File

@@ -0,0 +1,716 @@
// <auto-generated />
using System;
using Cowain.TestProject.DBContext;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Cowain.TestProject.Migrations
{
[DbContext(typeof(DBContextGenerator))]
[Migration("20260126053117_pallet_water_value_maxlength")]
partial class pallet_water_value_maxlength
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("Cowain.Base.Models.Admins.UserDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("Sex")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("UserNumber")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("user");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 26, 13, 31, 17, 455, DateTimeKind.Local).AddTicks(4003),
IsValid = true,
Name = "admin",
Password = "F44DDAC49CE7A95D",
Phone = "17625760609",
RoleId = 1,
Sex = "Male",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
UserNumber = "CWA4483"
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("user_role");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 26, 13, 31, 17, 460, DateTimeKind.Local).AddTicks(6222),
IsValid = true,
RoleName = "管理员",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleMenuDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("MenuActions")
.HasColumnType("longtext");
b.Property<string>("MenuKey")
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("user_role_menu");
b.HasData(
new
{
Id = 1,
MenuActions = "[]",
MenuKey = "Home",
RoleId = 1
},
new
{
Id = 2,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserRoleSetting",
RoleId = 1
},
new
{
Id = 3,
MenuActions = "[ \"edit\", \"delete\"]",
MenuKey = "RoleMenuSetting",
RoleId = 1
},
new
{
Id = 4,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserManagement",
RoleId = 1
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("DataValue")
.HasColumnType("longtext");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingVariableDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_variable");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BatteryInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("IsWaterBattery")
.HasColumnType("tinyint(1)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.Property<DateTime?>("ScanTime")
.HasColumnType("datetime(6)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<double>("WaterValue")
.HasColumnType("double");
b.HasKey("Id");
b.ToTable("battery_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletBindingDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("pallet_binding");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletStatus")
.HasColumnType("int");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime>("HistoryTime")
.HasMaxLength(200)
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletStatus")
.HasColumnType("int");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("pallet_info_history");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletStatusDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_status");
b.HasData(
new
{
Id = 1,
Desc = "新托盘",
Name = "New"
},
new
{
Id = 2,
Desc = "上料中",
Name = "Loading"
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.StationInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("LayOutX")
.HasColumnType("int");
b.Property<int>("LayOutY")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("station_info");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmGroupDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_group");
b.HasData(
new
{
Id = 1,
Name = "系统"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Group")
.HasColumnType("int");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<DateTime>("StartTime")
.HasColumnType("datetime(6)");
b.Property<bool>("Status")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("StopTime")
.HasColumnType("datetime(6)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("alarm_history");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmLevelDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Color")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_level");
b.HasData(
new
{
Id = 1,
Color = "Red",
Name = "报警"
},
new
{
Id = 2,
Color = "Yellow",
Name = "警告"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.DeviceDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("Desc")
.HasColumnType("longtext");
b.Property<string>("DeviceName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("DeviceType")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<string>("DriverName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("Enable")
.HasColumnType("tinyint(1)");
b.Property<string>("Param")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("device");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.TagAddressDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Address")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("AlarmEnable")
.HasColumnType("tinyint(1)");
b.Property<int>("AlarmGroup")
.HasColumnType("int");
b.Property<int>("AlarmLevel")
.HasColumnType("int");
b.Property<string>("AlarmMsg")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("AlarmValue")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("ArrayCount")
.HasColumnType("int");
b.Property<string>("DataType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Json")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("OperMode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("tag_address");
b.HasData(
new
{
Id = 1,
Address = "ns=4;s=L1RSTemp_Output1[0]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag1",
DeviceId = 1,
Json = "",
Name = "Tag1",
OperMode = "Read"
},
new
{
Id = 2,
Address = "ns=4;s=L1RSTemp_Output1[1]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag2",
DeviceId = 1,
Json = "",
Name = "Tag2",
OperMode = "Read"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.VarActionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ActionName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("ActionValue")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Condition")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Param")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("var_action");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,71 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Cowain.TestProject.Migrations
{
/// <inheritdoc />
public partial class pallet_water_value_maxlength : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "WaterValue",
table: "pallet_info",
type: "varchar(200)",
maxLength: 200,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 13, 31, 17, 455, DateTimeKind.Local).AddTicks(4003));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 13, 31, 17, 460, DateTimeKind.Local).AddTicks(6222));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "WaterValue",
table: "pallet_info",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(200)",
oldMaxLength: 200,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 13, 29, 18, 736, DateTimeKind.Local).AddTicks(5446));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 13, 29, 18, 741, DateTimeKind.Local).AddTicks(3327));
}
}
}

View File

@@ -0,0 +1,690 @@
// <auto-generated />
using System;
using Cowain.TestProject.DBContext;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Cowain.TestProject.Migrations
{
[DbContext(typeof(DBContextGenerator))]
[Migration("20260126122513_palletinfo")]
partial class palletinfo
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("Cowain.Base.Models.Admins.UserDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("Sex")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("UserNumber")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("user");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 26, 20, 25, 13, 22, DateTimeKind.Local).AddTicks(9183),
IsValid = true,
Name = "admin",
Password = "F44DDAC49CE7A95D",
Phone = "17625760609",
RoleId = 1,
Sex = "Male",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
UserNumber = "CWA4483"
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("user_role");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 26, 20, 25, 13, 34, DateTimeKind.Local).AddTicks(6570),
IsValid = true,
RoleName = "管理员",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleMenuDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("MenuActions")
.HasColumnType("longtext");
b.Property<string>("MenuKey")
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("user_role_menu");
b.HasData(
new
{
Id = 1,
MenuActions = "[]",
MenuKey = "Home",
RoleId = 1
},
new
{
Id = 2,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserRoleSetting",
RoleId = 1
},
new
{
Id = 3,
MenuActions = "[ \"edit\", \"delete\"]",
MenuKey = "RoleMenuSetting",
RoleId = 1
},
new
{
Id = 4,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserManagement",
RoleId = 1
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("DataValue")
.HasColumnType("longtext");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingVariableDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_variable");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BatteryInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("IsWaterBattery")
.HasColumnType("tinyint(1)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.Property<DateTime?>("ScanTime")
.HasColumnType("datetime(6)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<double>("WaterValue")
.HasColumnType("double");
b.HasKey("Id");
b.ToTable("battery_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletBindingDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("pallet_binding");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BakingCount")
.HasColumnType("int");
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("PalletStatus")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BakingCount")
.HasColumnType("int");
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime>("HistoryTime")
.HasMaxLength(200)
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("PalletStatus")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("pallet_info_history");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.StationInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("LayOutX")
.HasColumnType("int");
b.Property<int>("LayOutY")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("station_info");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmGroupDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_group");
b.HasData(
new
{
Id = 1,
Name = "系统"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Group")
.HasColumnType("int");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<DateTime>("StartTime")
.HasColumnType("datetime(6)");
b.Property<bool>("Status")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("StopTime")
.HasColumnType("datetime(6)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("alarm_history");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmLevelDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Color")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_level");
b.HasData(
new
{
Id = 1,
Color = "Red",
Name = "报警"
},
new
{
Id = 2,
Color = "Yellow",
Name = "警告"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.DeviceDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("Desc")
.HasColumnType("longtext");
b.Property<string>("DeviceName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("DeviceType")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<string>("DriverName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("Enable")
.HasColumnType("tinyint(1)");
b.Property<string>("Param")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("device");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.TagAddressDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Address")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("AlarmEnable")
.HasColumnType("tinyint(1)");
b.Property<int>("AlarmGroup")
.HasColumnType("int");
b.Property<int>("AlarmLevel")
.HasColumnType("int");
b.Property<string>("AlarmMsg")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("AlarmValue")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("ArrayCount")
.HasColumnType("int");
b.Property<string>("DataType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Json")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("OperMode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("tag_address");
b.HasData(
new
{
Id = 1,
Address = "ns=4;s=L1RSTemp_Output1[0]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag1",
DeviceId = 1,
Json = "",
Name = "Tag1",
OperMode = "Read"
},
new
{
Id = 2,
Address = "ns=4;s=L1RSTemp_Output1[1]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag2",
DeviceId = 1,
Json = "",
Name = "Tag2",
OperMode = "Read"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.VarActionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ActionName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("ActionValue")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Condition")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Param")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("var_action");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,148 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Cowain.TestProject.Migrations
{
/// <inheritdoc />
public partial class palletinfo : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "pallet_status");
migrationBuilder.AlterColumn<string>(
name: "PalletStatus",
table: "pallet_info_history",
type: "longtext",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<int>(
name: "BakingCount",
table: "pallet_info_history",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "BindingId",
table: "pallet_info_history",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AlterColumn<string>(
name: "PalletStatus",
table: "pallet_info",
type: "longtext",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<int>(
name: "BakingCount",
table: "pallet_info",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 20, 25, 13, 22, DateTimeKind.Local).AddTicks(9183));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 20, 25, 13, 34, DateTimeKind.Local).AddTicks(6570));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "BakingCount",
table: "pallet_info_history");
migrationBuilder.DropColumn(
name: "BindingId",
table: "pallet_info_history");
migrationBuilder.DropColumn(
name: "BakingCount",
table: "pallet_info");
migrationBuilder.AlterColumn<int>(
name: "PalletStatus",
table: "pallet_info_history",
type: "int",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<int>(
name: "PalletStatus",
table: "pallet_info",
type: "int",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "pallet_status",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Desc = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_pallet_status", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "pallet_status",
columns: new[] { "Id", "Desc", "Name" },
values: new object[,]
{
{ 1, "新托盘", "New" },
{ 2, "上料中", "Loading" }
});
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 13, 31, 17, 455, DateTimeKind.Local).AddTicks(4003));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 13, 31, 17, 460, DateTimeKind.Local).AddTicks(6222));
}
}
}

View File

@@ -0,0 +1,692 @@
// <auto-generated />
using System;
using Cowain.TestProject.DBContext;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Cowain.TestProject.Migrations
{
[DbContext(typeof(DBContextGenerator))]
[Migration("20260126124929_palletinfo_length")]
partial class palletinfo_length
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("Cowain.Base.Models.Admins.UserDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("Sex")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("UserNumber")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("user");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 26, 20, 49, 28, 660, DateTimeKind.Local).AddTicks(505),
IsValid = true,
Name = "admin",
Password = "F44DDAC49CE7A95D",
Phone = "17625760609",
RoleId = 1,
Sex = "Male",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
UserNumber = "CWA4483"
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("user_role");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 26, 20, 49, 28, 665, DateTimeKind.Local).AddTicks(3692),
IsValid = true,
RoleName = "管理员",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleMenuDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("MenuActions")
.HasColumnType("longtext");
b.Property<string>("MenuKey")
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("user_role_menu");
b.HasData(
new
{
Id = 1,
MenuActions = "[]",
MenuKey = "Home",
RoleId = 1
},
new
{
Id = 2,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserRoleSetting",
RoleId = 1
},
new
{
Id = 3,
MenuActions = "[ \"edit\", \"delete\"]",
MenuKey = "RoleMenuSetting",
RoleId = 1
},
new
{
Id = 4,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserManagement",
RoleId = 1
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("DataValue")
.HasColumnType("longtext");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingVariableDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_variable");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BatteryInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("IsWaterBattery")
.HasColumnType("tinyint(1)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.Property<DateTime?>("ScanTime")
.HasColumnType("datetime(6)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<double>("WaterValue")
.HasColumnType("double");
b.HasKey("Id");
b.ToTable("battery_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletBindingDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("pallet_binding");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BakingCount")
.HasColumnType("int");
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("PalletStatus")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BakingCount")
.HasColumnType("int");
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime>("HistoryTime")
.HasMaxLength(200)
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("PalletStatus")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("pallet_info_history");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.StationInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("LayOutX")
.HasColumnType("int");
b.Property<int>("LayOutY")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("station_info");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmGroupDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_group");
b.HasData(
new
{
Id = 1,
Name = "系统"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Group")
.HasColumnType("int");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<DateTime>("StartTime")
.HasColumnType("datetime(6)");
b.Property<bool>("Status")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("StopTime")
.HasColumnType("datetime(6)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("alarm_history");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmLevelDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Color")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_level");
b.HasData(
new
{
Id = 1,
Color = "Red",
Name = "报警"
},
new
{
Id = 2,
Color = "Yellow",
Name = "警告"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.DeviceDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("Desc")
.HasColumnType("longtext");
b.Property<string>("DeviceName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("DeviceType")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<string>("DriverName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("Enable")
.HasColumnType("tinyint(1)");
b.Property<string>("Param")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("device");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.TagAddressDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Address")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("AlarmEnable")
.HasColumnType("tinyint(1)");
b.Property<int>("AlarmGroup")
.HasColumnType("int");
b.Property<int>("AlarmLevel")
.HasColumnType("int");
b.Property<string>("AlarmMsg")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("AlarmValue")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("ArrayCount")
.HasColumnType("int");
b.Property<string>("DataType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Json")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("OperMode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("tag_address");
b.HasData(
new
{
Id = 1,
Address = "ns=4;s=L1RSTemp_Output1[0]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag1",
DeviceId = 1,
Json = "",
Name = "Tag1",
OperMode = "Read"
},
new
{
Id = 2,
Address = "ns=4;s=L1RSTemp_Output1[1]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag2",
DeviceId = 1,
Json = "",
Name = "Tag2",
OperMode = "Read"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.VarActionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ActionName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("ActionValue")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Condition")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Param")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("var_action");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,91 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Cowain.TestProject.Migrations
{
/// <inheritdoc />
public partial class palletinfo_length : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "PalletStatus",
table: "pallet_info_history",
type: "varchar(200)",
maxLength: 200,
nullable: false,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "PalletStatus",
table: "pallet_info",
type: "varchar(200)",
maxLength: 200,
nullable: false,
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 20, 49, 28, 660, DateTimeKind.Local).AddTicks(505));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 20, 49, 28, 665, DateTimeKind.Local).AddTicks(3692));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "PalletStatus",
table: "pallet_info_history",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(200)",
oldMaxLength: 200)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "PalletStatus",
table: "pallet_info",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(200)",
oldMaxLength: 200)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 20, 25, 13, 22, DateTimeKind.Local).AddTicks(9183));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 20, 25, 13, 34, DateTimeKind.Local).AddTicks(6570));
}
}
}

View File

@@ -0,0 +1,699 @@
// <auto-generated />
using System;
using Cowain.TestProject.DBContext;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Cowain.TestProject.Migrations
{
[DbContext(typeof(DBContextGenerator))]
[Migration("20260127070650_baking_mode_edit")]
partial class baking_mode_edit
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("Cowain.Base.Models.Admins.UserDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("Sex")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("UserNumber")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("user");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 27, 15, 6, 49, 534, DateTimeKind.Local).AddTicks(5788),
IsValid = true,
Name = "admin",
Password = "F44DDAC49CE7A95D",
Phone = "17625760609",
RoleId = 1,
Sex = "Male",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
UserNumber = "CWA4483"
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("user_role");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 27, 15, 6, 49, 543, DateTimeKind.Local).AddTicks(1528),
IsValid = true,
RoleName = "管理员",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleMenuDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("MenuActions")
.HasColumnType("longtext");
b.Property<string>("MenuKey")
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("user_role_menu");
b.HasData(
new
{
Id = 1,
MenuActions = "[]",
MenuKey = "Home",
RoleId = 1
},
new
{
Id = 2,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserRoleSetting",
RoleId = 1
},
new
{
Id = 3,
MenuActions = "[ \"edit\", \"delete\"]",
MenuKey = "RoleMenuSetting",
RoleId = 1
},
new
{
Id = 4,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserManagement",
RoleId = 1
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("DataValue")
.HasColumnType("longtext");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingVariableDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_variable");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BatteryInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("Col")
.HasColumnType("int");
b.Property<bool>("IsWaterBattery")
.HasColumnType("tinyint(1)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.Property<int>("Row")
.HasColumnType("int");
b.Property<DateTime?>("ScanTime")
.HasColumnType("datetime(6)");
b.Property<string>("Status")
.HasColumnType("longtext");
b.Property<string>("WaterValue")
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("battery_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletBindingDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("pallet_binding");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BakingCount")
.HasColumnType("int");
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("PalletStatus")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BakingCount")
.HasColumnType("int");
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime>("HistoryTime")
.HasMaxLength(200)
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("PalletStatus")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_info_history");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.StationInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("LayOutX")
.HasColumnType("int");
b.Property<int>("LayOutY")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("station_info");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmGroupDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_group");
b.HasData(
new
{
Id = 1,
Name = "系统"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Group")
.HasColumnType("int");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<DateTime>("StartTime")
.HasColumnType("datetime(6)");
b.Property<bool>("Status")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("StopTime")
.HasColumnType("datetime(6)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("alarm_history");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmLevelDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Color")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_level");
b.HasData(
new
{
Id = 1,
Color = "Red",
Name = "报警"
},
new
{
Id = 2,
Color = "Yellow",
Name = "警告"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.DeviceDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("Desc")
.HasColumnType("longtext");
b.Property<string>("DeviceName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("DeviceType")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<string>("DriverName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("Enable")
.HasColumnType("tinyint(1)");
b.Property<string>("Param")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("device");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.TagAddressDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Address")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("AlarmEnable")
.HasColumnType("tinyint(1)");
b.Property<int>("AlarmGroup")
.HasColumnType("int");
b.Property<int>("AlarmLevel")
.HasColumnType("int");
b.Property<string>("AlarmMsg")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("AlarmValue")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("ArrayCount")
.HasColumnType("int");
b.Property<string>("DataType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Json")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("OperMode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("tag_address");
b.HasData(
new
{
Id = 1,
Address = "ns=4;s=L1RSTemp_Output1[0]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag1",
DeviceId = 1,
Json = "",
Name = "Tag1",
OperMode = "Read"
},
new
{
Id = 2,
Address = "ns=4;s=L1RSTemp_Output1[1]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag2",
DeviceId = 1,
Json = "",
Name = "Tag2",
OperMode = "Read"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.VarActionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ActionName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("ActionValue")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Condition")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Param")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("var_action");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,133 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Cowain.TestProject.Migrations
{
/// <inheritdoc />
public partial class baking_mode_edit : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "WaterValue",
table: "pallet_info_history",
type: "varchar(200)",
maxLength: 200,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "WaterValue",
table: "battery_info",
type: "longtext",
nullable: true,
oldClrType: typeof(double),
oldType: "double")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Status",
table: "battery_info",
type: "longtext",
nullable: true,
oldClrType: typeof(int),
oldType: "int")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<int>(
name: "Col",
table: "battery_info",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "Row",
table: "battery_info",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 27, 15, 6, 49, 534, DateTimeKind.Local).AddTicks(5788));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 27, 15, 6, 49, 543, DateTimeKind.Local).AddTicks(1528));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Col",
table: "battery_info");
migrationBuilder.DropColumn(
name: "Row",
table: "battery_info");
migrationBuilder.AlterColumn<string>(
name: "WaterValue",
table: "pallet_info_history",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(200)",
oldMaxLength: 200,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<double>(
name: "WaterValue",
table: "battery_info",
type: "double",
nullable: false,
defaultValue: 0.0,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<int>(
name: "Status",
table: "battery_info",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 20, 49, 28, 660, DateTimeKind.Local).AddTicks(505));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 26, 20, 49, 28, 665, DateTimeKind.Local).AddTicks(3692));
}
}
}

View File

@@ -0,0 +1,702 @@
// <auto-generated />
using System;
using Cowain.TestProject.DBContext;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Cowain.TestProject.Migrations
{
[DbContext(typeof(DBContextGenerator))]
[Migration("20260127070916_baking_mode_lenght")]
partial class baking_mode_lenght
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("Cowain.Base.Models.Admins.UserDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("Sex")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("UserNumber")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("user");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 27, 15, 9, 15, 656, DateTimeKind.Local).AddTicks(622),
IsValid = true,
Name = "admin",
Password = "F44DDAC49CE7A95D",
Phone = "17625760609",
RoleId = 1,
Sex = "Male",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
UserNumber = "CWA4483"
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("user_role");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 27, 15, 9, 15, 660, DateTimeKind.Local).AddTicks(9473),
IsValid = true,
RoleName = "管理员",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleMenuDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("MenuActions")
.HasColumnType("longtext");
b.Property<string>("MenuKey")
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("user_role_menu");
b.HasData(
new
{
Id = 1,
MenuActions = "[]",
MenuKey = "Home",
RoleId = 1
},
new
{
Id = 2,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserRoleSetting",
RoleId = 1
},
new
{
Id = 3,
MenuActions = "[ \"edit\", \"delete\"]",
MenuKey = "RoleMenuSetting",
RoleId = 1
},
new
{
Id = 4,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserManagement",
RoleId = 1
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("DataValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingVariableDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_variable");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BatteryInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("Col")
.HasColumnType("int");
b.Property<bool>("IsWaterBattery")
.HasColumnType("tinyint(1)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.Property<int>("Row")
.HasColumnType("int");
b.Property<DateTime?>("ScanTime")
.HasColumnType("datetime(6)");
b.Property<string>("Status")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("battery_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletBindingDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("pallet_binding");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BakingCount")
.HasColumnType("int");
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("PalletStatus")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BakingCount")
.HasColumnType("int");
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime>("HistoryTime")
.HasMaxLength(200)
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("PalletStatus")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_info_history");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.StationInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("LayOutX")
.HasColumnType("int");
b.Property<int>("LayOutY")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("station_info");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmGroupDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_group");
b.HasData(
new
{
Id = 1,
Name = "系统"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Group")
.HasColumnType("int");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<DateTime>("StartTime")
.HasColumnType("datetime(6)");
b.Property<bool>("Status")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("StopTime")
.HasColumnType("datetime(6)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("alarm_history");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmLevelDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Color")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_level");
b.HasData(
new
{
Id = 1,
Color = "Red",
Name = "报警"
},
new
{
Id = 2,
Color = "Yellow",
Name = "警告"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.DeviceDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("Desc")
.HasColumnType("longtext");
b.Property<string>("DeviceName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("DeviceType")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<string>("DriverName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("Enable")
.HasColumnType("tinyint(1)");
b.Property<string>("Param")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("device");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.TagAddressDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Address")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("AlarmEnable")
.HasColumnType("tinyint(1)");
b.Property<int>("AlarmGroup")
.HasColumnType("int");
b.Property<int>("AlarmLevel")
.HasColumnType("int");
b.Property<string>("AlarmMsg")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("AlarmValue")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("ArrayCount")
.HasColumnType("int");
b.Property<string>("DataType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Json")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("OperMode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("tag_address");
b.HasData(
new
{
Id = 1,
Address = "ns=4;s=L1RSTemp_Output1[0]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag1",
DeviceId = 1,
Json = "",
Name = "Tag1",
OperMode = "Read"
},
new
{
Id = 2,
Address = "ns=4;s=L1RSTemp_Output1[1]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag2",
DeviceId = 1,
Json = "",
Name = "Tag2",
OperMode = "Read"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.VarActionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ActionName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("ActionValue")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Condition")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Param")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("var_action");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,119 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Cowain.TestProject.Migrations
{
/// <inheritdoc />
public partial class baking_mode_lenght : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "WaterValue",
table: "battery_info",
type: "varchar(200)",
maxLength: 200,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Status",
table: "battery_info",
type: "varchar(200)",
maxLength: 200,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "DataValue",
table: "baking_info",
type: "varchar(200)",
maxLength: 200,
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 27, 15, 9, 15, 656, DateTimeKind.Local).AddTicks(622));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 27, 15, 9, 15, 660, DateTimeKind.Local).AddTicks(9473));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "WaterValue",
table: "battery_info",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(200)",
oldMaxLength: 200,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "Status",
table: "battery_info",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(200)",
oldMaxLength: 200,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "DataValue",
table: "baking_info",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "varchar(200)",
oldMaxLength: 200,
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 27, 15, 6, 49, 534, DateTimeKind.Local).AddTicks(5788));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 27, 15, 6, 49, 543, DateTimeKind.Local).AddTicks(1528));
}
}
}

View File

@@ -0,0 +1,710 @@
// <auto-generated />
using System;
using Cowain.TestProject.DBContext;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Cowain.TestProject.Migrations
{
[DbContext(typeof(DBContextGenerator))]
[Migration("20260128071034_baking_mode_station")]
partial class baking_mode_station
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("Cowain.Base.Models.Admins.UserDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("Sex")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("UserNumber")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("user");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 28, 15, 10, 33, 689, DateTimeKind.Local).AddTicks(249),
IsValid = true,
Name = "admin",
Password = "F44DDAC49CE7A95D",
Phone = "17625760609",
RoleId = 1,
Sex = "Male",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
UserNumber = "CWA4483"
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("user_role");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 28, 15, 10, 33, 696, DateTimeKind.Local).AddTicks(8625),
IsValid = true,
RoleName = "管理员",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleMenuDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("MenuActions")
.HasColumnType("longtext");
b.Property<string>("MenuKey")
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("user_role_menu");
b.HasData(
new
{
Id = 1,
MenuActions = "[]",
MenuKey = "Home",
RoleId = 1
},
new
{
Id = 2,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserRoleSetting",
RoleId = 1
},
new
{
Id = 3,
MenuActions = "[ \"edit\", \"delete\"]",
MenuKey = "RoleMenuSetting",
RoleId = 1
},
new
{
Id = 4,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserManagement",
RoleId = 1
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("DataValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingVariableDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_variable");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BatteryInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("Col")
.HasColumnType("int");
b.Property<bool>("IsWaterBattery")
.HasColumnType("tinyint(1)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.Property<int>("Row")
.HasColumnType("int");
b.Property<DateTime?>("ScanTime")
.HasColumnType("datetime(6)");
b.Property<string>("Status")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("battery_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletBindingDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("pallet_binding");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BakingCount")
.HasColumnType("int");
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("PalletStatus")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BakingCount")
.HasColumnType("int");
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime>("HistoryTime")
.HasMaxLength(200)
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("PalletStatus")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_info_history");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.StationInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Enable")
.HasColumnType("tinyint(1)");
b.Property<int>("LayOutX")
.HasColumnType("int");
b.Property<int>("LayOutY")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("StationCode")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("station_info");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmGroupDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_group");
b.HasData(
new
{
Id = 1,
Name = "系统"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Group")
.HasColumnType("int");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<DateTime>("StartTime")
.HasColumnType("datetime(6)");
b.Property<bool>("Status")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("StopTime")
.HasColumnType("datetime(6)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("alarm_history");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmLevelDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Color")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_level");
b.HasData(
new
{
Id = 1,
Color = "Red",
Name = "报警"
},
new
{
Id = 2,
Color = "Yellow",
Name = "警告"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.DeviceDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("Desc")
.HasColumnType("longtext");
b.Property<string>("DeviceName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("DeviceType")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<string>("DriverName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("Enable")
.HasColumnType("tinyint(1)");
b.Property<string>("Param")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("device");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.TagAddressDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Address")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("AlarmEnable")
.HasColumnType("tinyint(1)");
b.Property<int>("AlarmGroup")
.HasColumnType("int");
b.Property<int>("AlarmLevel")
.HasColumnType("int");
b.Property<string>("AlarmMsg")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("AlarmValue")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("ArrayCount")
.HasColumnType("int");
b.Property<string>("DataType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Json")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("OperMode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("tag_address");
b.HasData(
new
{
Id = 1,
Address = "ns=4;s=L1RSTemp_Output1[0]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag1",
DeviceId = 1,
Json = "",
Name = "Tag1",
OperMode = "Read"
},
new
{
Id = 2,
Address = "ns=4;s=L1RSTemp_Output1[1]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag2",
DeviceId = 1,
Json = "",
Name = "Tag2",
OperMode = "Read"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.VarActionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ActionName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("ActionValue")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Condition")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Param")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("var_action");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,71 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Cowain.TestProject.Migrations
{
/// <inheritdoc />
public partial class baking_mode_station : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "Enable",
table: "station_info",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "StationCode",
table: "station_info",
type: "varchar(200)",
maxLength: 200,
nullable: false,
defaultValue: "")
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 28, 15, 10, 33, 689, DateTimeKind.Local).AddTicks(249));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 28, 15, 10, 33, 696, DateTimeKind.Local).AddTicks(8625));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Enable",
table: "station_info");
migrationBuilder.DropColumn(
name: "StationCode",
table: "station_info");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 27, 15, 9, 15, 656, DateTimeKind.Local).AddTicks(622));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 27, 15, 9, 15, 660, DateTimeKind.Local).AddTicks(9473));
}
}
}

View File

@@ -0,0 +1,716 @@
// <auto-generated />
using System;
using Cowain.TestProject.DBContext;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Cowain.TestProject.Migrations
{
[DbContext(typeof(DBContextGenerator))]
[Migration("20260128080126_baking_mode_station_wh")]
partial class baking_mode_station_wh
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("Cowain.Base.Models.Admins.UserDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("Sex")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("UserNumber")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("user");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 28, 16, 1, 26, 47, DateTimeKind.Local).AddTicks(4627),
IsValid = true,
Name = "admin",
Password = "F44DDAC49CE7A95D",
Phone = "17625760609",
RoleId = 1,
Sex = "Male",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
UserNumber = "CWA4483"
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("user_role");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 28, 16, 1, 26, 52, DateTimeKind.Local).AddTicks(3720),
IsValid = true,
RoleName = "管理员",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleMenuDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("MenuActions")
.HasColumnType("longtext");
b.Property<string>("MenuKey")
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("user_role_menu");
b.HasData(
new
{
Id = 1,
MenuActions = "[]",
MenuKey = "Home",
RoleId = 1
},
new
{
Id = 2,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserRoleSetting",
RoleId = 1
},
new
{
Id = 3,
MenuActions = "[ \"edit\", \"delete\"]",
MenuKey = "RoleMenuSetting",
RoleId = 1
},
new
{
Id = 4,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserManagement",
RoleId = 1
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("DataValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingVariableDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_variable");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BatteryInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("Col")
.HasColumnType("int");
b.Property<bool>("IsWaterBattery")
.HasColumnType("tinyint(1)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.Property<int>("Row")
.HasColumnType("int");
b.Property<DateTime?>("ScanTime")
.HasColumnType("datetime(6)");
b.Property<string>("Status")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("battery_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletBindingDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("pallet_binding");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BakingCount")
.HasColumnType("int");
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("PalletStatus")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BakingCount")
.HasColumnType("int");
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime>("HistoryTime")
.HasMaxLength(200)
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("PalletStatus")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_info_history");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.StationInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Enable")
.HasColumnType("tinyint(1)");
b.Property<int>("Height")
.HasColumnType("int");
b.Property<int>("LayOutX")
.HasColumnType("int");
b.Property<int>("LayOutY")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("StationCode")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("Width")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("station_info");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmGroupDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_group");
b.HasData(
new
{
Id = 1,
Name = "系统"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Group")
.HasColumnType("int");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<DateTime>("StartTime")
.HasColumnType("datetime(6)");
b.Property<bool>("Status")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("StopTime")
.HasColumnType("datetime(6)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("alarm_history");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmLevelDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Color")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_level");
b.HasData(
new
{
Id = 1,
Color = "Red",
Name = "报警"
},
new
{
Id = 2,
Color = "Yellow",
Name = "警告"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.DeviceDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("Desc")
.HasColumnType("longtext");
b.Property<string>("DeviceName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("DeviceType")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<string>("DriverName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("Enable")
.HasColumnType("tinyint(1)");
b.Property<string>("Param")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("device");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.TagAddressDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Address")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("AlarmEnable")
.HasColumnType("tinyint(1)");
b.Property<int>("AlarmGroup")
.HasColumnType("int");
b.Property<int>("AlarmLevel")
.HasColumnType("int");
b.Property<string>("AlarmMsg")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("AlarmValue")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("ArrayCount")
.HasColumnType("int");
b.Property<string>("DataType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Json")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("OperMode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("tag_address");
b.HasData(
new
{
Id = 1,
Address = "ns=4;s=L1RSTemp_Output1[0]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag1",
DeviceId = 1,
Json = "",
Name = "Tag1",
OperMode = "Read"
},
new
{
Id = 2,
Address = "ns=4;s=L1RSTemp_Output1[1]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag2",
DeviceId = 1,
Json = "",
Name = "Tag2",
OperMode = "Read"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.VarActionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ActionName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("ActionValue")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Condition")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Param")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("var_action");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,69 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Cowain.TestProject.Migrations
{
/// <inheritdoc />
public partial class baking_mode_station_wh : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "Height",
table: "station_info",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "Width",
table: "station_info",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 28, 16, 1, 26, 47, DateTimeKind.Local).AddTicks(4627));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 28, 16, 1, 26, 52, DateTimeKind.Local).AddTicks(3720));
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Height",
table: "station_info");
migrationBuilder.DropColumn(
name: "Width",
table: "station_info");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 28, 15, 10, 33, 689, DateTimeKind.Local).AddTicks(249));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 1, 28, 15, 10, 33, 696, DateTimeKind.Local).AddTicks(8625));
}
}
}

View File

@@ -0,0 +1,713 @@
// <auto-generated />
using System;
using Cowain.TestProject.DBContext;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Cowain.TestProject.Migrations
{
[DbContext(typeof(DBContextGenerator))]
partial class DBContextGeneratorModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("Cowain.Base.Models.Admins.UserDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.Property<string>("Sex")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("UserNumber")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("user");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 28, 16, 1, 26, 47, DateTimeKind.Local).AddTicks(4627),
IsValid = true,
Name = "admin",
Password = "F44DDAC49CE7A95D",
Phone = "17625760609",
RoleId = 1,
Sex = "Male",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
UserNumber = "CWA4483"
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<bool>("IsValid")
.HasColumnType("tinyint(1)");
b.Property<string>("RoleName")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("user_role");
b.HasData(
new
{
Id = 1,
CreateTime = new DateTime(2026, 1, 28, 16, 1, 26, 52, DateTimeKind.Local).AddTicks(3720),
IsValid = true,
RoleName = "管理员",
UpdateTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)
});
});
modelBuilder.Entity("Cowain.Base.Models.Admins.UserRoleMenuDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("MenuActions")
.HasColumnType("longtext");
b.Property<string>("MenuKey")
.HasColumnType("longtext");
b.Property<int>("RoleId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("user_role_menu");
b.HasData(
new
{
Id = 1,
MenuActions = "[]",
MenuKey = "Home",
RoleId = 1
},
new
{
Id = 2,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserRoleSetting",
RoleId = 1
},
new
{
Id = 3,
MenuActions = "[ \"edit\", \"delete\"]",
MenuKey = "RoleMenuSetting",
RoleId = 1
},
new
{
Id = 4,
MenuActions = "[ \"add\", \"edit\", \"delete\"]",
MenuKey = "UserManagement",
RoleId = 1
});
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<DateTime?>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("DataValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BakingVariableDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("baking_variable");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.BatteryInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("Col")
.HasColumnType("int");
b.Property<bool>("IsWaterBattery")
.HasColumnType("tinyint(1)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.Property<int>("Row")
.HasColumnType("int");
b.Property<DateTime?>("ScanTime")
.HasColumnType("datetime(6)");
b.Property<string>("Status")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("battery_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletBindingDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<int>("PalletId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("pallet_binding");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BakingCount")
.HasColumnType("int");
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("PalletStatus")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("UpdateTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_info");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.PalletInfoHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BakingCount")
.HasColumnType("int");
b.Property<DateTime?>("BakingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("BakingStartTime")
.HasColumnType("datetime(6)");
b.Property<int>("BindingId")
.HasColumnType("int");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<DateTime>("HistoryTime")
.HasMaxLength(200)
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingEndTime")
.HasColumnType("datetime(6)");
b.Property<DateTime?>("LoadingStartTime")
.HasColumnType("datetime(6)");
b.Property<string>("PalletStatus")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("StationId")
.HasColumnType("int");
b.Property<DateTime?>("UnLoadingTime")
.HasColumnType("datetime(6)");
b.Property<string>("WaterValue")
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("pallet_info_history");
});
modelBuilder.Entity("Plugin.Cowain.Baking.Models.Dto.StationInfoDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("Enable")
.HasColumnType("tinyint(1)");
b.Property<int>("Height")
.HasColumnType("int");
b.Property<int>("LayOutX")
.HasColumnType("int");
b.Property<int>("LayOutY")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("StationCode")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<int>("Width")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("station_info");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmGroupDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_group");
b.HasData(
new
{
Id = 1,
Name = "系统"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmHistoryDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Group")
.HasColumnType("int");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<DateTime>("StartTime")
.HasColumnType("datetime(6)");
b.Property<bool>("Status")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("StopTime")
.HasColumnType("datetime(6)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("alarm_history");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.AlarmLevelDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Color")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.HasKey("Id");
b.ToTable("alarm_level");
b.HasData(
new
{
Id = 1,
Color = "Red",
Name = "报警"
},
new
{
Id = 2,
Color = "Yellow",
Name = "警告"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.DeviceDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime(6)");
b.Property<string>("Desc")
.HasColumnType("longtext");
b.Property<string>("DeviceName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("DeviceType")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("varchar(20)");
b.Property<string>("DriverName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<bool>("Enable")
.HasColumnType("tinyint(1)");
b.Property<string>("Param")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.ToTable("device");
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.TagAddressDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Address")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<bool>("AlarmEnable")
.HasColumnType("tinyint(1)");
b.Property<int>("AlarmGroup")
.HasColumnType("int");
b.Property<int>("AlarmLevel")
.HasColumnType("int");
b.Property<string>("AlarmMsg")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("AlarmValue")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("ArrayCount")
.HasColumnType("int");
b.Property<string>("DataType")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Desc")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Json")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("OperMode")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("tag_address");
b.HasData(
new
{
Id = 1,
Address = "ns=4;s=L1RSTemp_Output1[0]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag1",
DeviceId = 1,
Json = "",
Name = "Tag1",
OperMode = "Read"
},
new
{
Id = 2,
Address = "ns=4;s=L1RSTemp_Output1[1]",
AlarmEnable = false,
AlarmGroup = 0,
AlarmLevel = 0,
AlarmMsg = "",
AlarmValue = "",
ArrayCount = 1,
DataType = "Int16",
Desc = "Tag2",
DeviceId = 1,
Json = "",
Name = "Tag2",
OperMode = "Read"
});
});
modelBuilder.Entity("Plugin.Cowain.Driver.Models.Dto.VarActionDto", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ActionName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("ActionValue")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Condition")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("varchar(200)");
b.Property<string>("Desc")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<int>("DeviceId")
.HasColumnType("int");
b.Property<string>("Param")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("varchar(1000)");
b.Property<int>("TagId")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("var_action");
});
#pragma warning restore 612, 618
}
}
}