Files
WCS/Cowain.TestProject/Migrations/20260302103947_wcs.cs
2026-03-02 18:53:12 +08:00

249 lines
13 KiB
C#

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 wcs : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "process",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
FlowData = table.Column<string>(type: "longtext", nullable: false)
.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),
Json = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_process", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "process_flow",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ProcessId = table.Column<int>(type: "int", nullable: false),
Priority = table.Column<int>(type: "int", nullable: false),
FromStationId1 = table.Column<int>(type: "int", nullable: false),
ToStationId1 = table.Column<int>(type: "int", nullable: false),
FromStatus1 = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ToStatus1 = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
FromStationId2 = table.Column<int>(type: "int", nullable: false),
ToStationId2 = table.Column<int>(type: "int", nullable: false),
FromStatus2 = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ToStatus2 = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Action = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_process_flow", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "rgv",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
StationName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
StationCode = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ProcessName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
FromStationId1 = table.Column<int>(type: "int", nullable: false),
ToStationId1 = table.Column<int>(type: "int", nullable: false),
FromStationId2 = table.Column<int>(type: "int", nullable: false),
ToStationId2 = table.Column<int>(type: "int", nullable: false),
QrCode1 = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
QrCode2 = 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),
Json = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_rgv", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "station",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
StationName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
StationCode = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
QrCode = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ProcessName = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
PositionX = table.Column<float>(type: "float", nullable: false),
PositionY = table.Column<float>(type: "float", nullable: false),
PositionZ = table.Column<float>(type: "float", nullable: false),
LayOutX = table.Column<int>(type: "int", nullable: false),
LayOutY = table.Column<int>(type: "int", nullable: false),
StationPos = table.Column<int>(type: "int", nullable: false),
Status = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Enable = table.Column<bool>(type: "tinyint(1)", nullable: false),
NextStationId = table.Column<int>(type: "int", 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_station", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "task_data",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ProcessName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ProcessId = table.Column<int>(type: "int", nullable: false),
Priority = table.Column<int>(type: "int", nullable: false),
QrCode1 = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
QrCode2 = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
FromStationId1 = table.Column<int>(type: "int", nullable: false),
ToStationId1 = table.Column<int>(type: "int", nullable: false),
FromStatus1 = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ToStatus1 = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
FromStationId2 = table.Column<int>(type: "int", nullable: false),
ToStationId2 = table.Column<int>(type: "int", nullable: false),
FromStatus2 = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ToStatus2 = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ExecuteAction = table.Column<int>(type: "int", nullable: false),
IsFinished = table.Column<bool>(type: "tinyint(1)", nullable: false),
Action = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CreateTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
FinishedTime = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_task_data", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "wcs_param",
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"),
Param = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_wcs_param", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 3, 2, 18, 39, 47, 481, DateTimeKind.Local).AddTicks(5662));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 3, 2, 18, 39, 47, 486, DateTimeKind.Local).AddTicks(6948));
migrationBuilder.InsertData(
table: "wcs_param",
columns: new[] { "Id", "Name", "Param" },
values: new object[,]
{
{ 1, "FindTaskOnStartUp", "True" },
{ 2, "FindTaskEnable", "True" }
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "process");
migrationBuilder.DropTable(
name: "process_flow");
migrationBuilder.DropTable(
name: "rgv");
migrationBuilder.DropTable(
name: "station");
migrationBuilder.DropTable(
name: "task_data");
migrationBuilder.DropTable(
name: "wcs_param");
migrationBuilder.UpdateData(
table: "user",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 3, 2, 9, 47, 14, 393, DateTimeKind.Local).AddTicks(8647));
migrationBuilder.UpdateData(
table: "user_role",
keyColumn: "Id",
keyValue: 1,
column: "CreateTime",
value: new DateTime(2026, 3, 2, 9, 47, 14, 401, DateTimeKind.Local).AddTicks(47));
}
}
}