schangxiang@126.com
2025-05-08 8e83181db5ff4463949c8a15e56a2163a5616845
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Weben_CMS_TemplateDemo/server/src/CMS.Plugin.HIAWms.MySQL/Migrations/20250508083921_InitialCreate4.cs
ÎļþÃû´Ó Weben_CMSרÓôúÂëÉú³ÉÆ÷/Weben_CMS_TemplateDemo/server/src/CMS.Plugin.HIAWms.MySQL/Migrations/20250429025531_InitialCreate.cs ÐÞ¸Ä
@@ -5,7 +5,7 @@
namespace CMS.Plugin.HIAWms.MySQL.Migrations
{
    public partial class InitialCreate : Migration
    public partial class InitialCreate4 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
@@ -106,6 +106,54 @@
                .Annotation("MySql:CharSet", "utf8mb4");
            migrationBuilder.CreateTable(
                name: "scms_wmsinoutstockrecords",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    OrderNo = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "单据编号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MaterialName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true, comment: "物料名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MaterialNo = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物料件号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    StockType = table.Column<int>(type: "int", nullable: false, comment: "操作类型"),
                    ContainerNo = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "容器编号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MaterialModel = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "机型")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    OperateTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "操作时间"),
                    Remark = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "备注")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MaterialId = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "物料ID")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    TaskNo = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "任务号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    SourcePlace = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "起始库位")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ToPlace = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "目标库位")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    IsDisabled = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "是否禁用"),
                    ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
                    DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_scms_wmsinoutstockrecords", x => x.Id);
                },
                comment: "出入库记录表")
                .Annotation("MySql:CharSet", "utf8mb4");
            migrationBuilder.CreateTable(
                name: "scms_wmsmaterials",
                columns: table => new
                {
@@ -125,7 +173,7 @@
                    MaterialQuality = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true, comment: "材质(如:304不锈钢)")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Length = table.Column<decimal>(type: "decimal(18,2)", nullable: false, comment: "长度(单位:m)"),
                    IsMainBranch = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "是否为主支管"),
                    IsMainBranch = table.Column<int>(type: "int", nullable: false, defaultValue: 2, comment: "是否为主支管"),
                    Factory = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true, comment: "生产工厂")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Certification = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true, comment: "证书编号")
@@ -136,21 +184,25 @@
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    RedundantField3 = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "冗余字段3 - é¢„留扩展用途")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ExtraProperties = table.Column<string>(type: "longtext", nullable: true, comment: "扩展属性")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true, comment: "并发戳")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "创建时间"),
                    CreatorId = table.Column<Guid>(type: "char(36)", maxLength: 36, nullable: true, comment: "创建人ID", collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "修改时间"),
                    LastModifierId = table.Column<Guid>(type: "char(36)", maxLength: 36, nullable: true, comment: "修改人ID", collation: "ascii_general_ci"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false, comment: "是否删除"),
                    DeleterId = table.Column<Guid>(type: "char(36)", maxLength: 36, nullable: true, comment: "删除人ID", collation: "ascii_general_ci"),
                    DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "删除时间"),
                    CreatorName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true, comment: "创建人")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    LastModifierName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true, comment: "修改人")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Sort = table.Column<int>(type: "int", nullable: false, defaultValue: 0, comment: "排序"),
                    Remark = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true, comment: "备注")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsDisabled = table.Column<bool>(type: "tinyint(1)", nullable: true, defaultValue: false, comment: "是否禁用"),
                    ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
                    DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
                    IsDisabled = table.Column<bool>(type: "tinyint(1)", nullable: true, defaultValue: false, comment: "是否禁用")
                },
                constraints: table =>
                {
@@ -243,6 +295,58 @@
                comment: "仓库信息表")
                .Annotation("MySql:CharSet", "utf8mb4");
            migrationBuilder.CreateTable(
                name: "scms_wmstasks",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    TaskNo = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false, comment: "任务号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    TaskType = table.Column<int>(type: "int", nullable: false, comment: "任务类型"),
                    TaskLevel = table.Column<int>(type: "int", nullable: false, comment: "任务等级"),
                    TaskStatus = table.Column<int>(type: "int", nullable: false, comment: "任务状态"),
                    ContainerNo = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "托盘编号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    SourcePlace = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "起始库位")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ToPlace = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "目标库位")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Aisle = table.Column<int>(type: "int", nullable: true, comment: "巷道"),
                    DodeviceId = table.Column<int>(type: "int", nullable: true, comment: "堆垛机ID"),
                    Dodevicetype = table.Column<int>(type: "int", nullable: false, comment: "设备类型"),
                    TaskDodeviceStatus = table.Column<int>(type: "int", nullable: false, comment: "设备任务状态"),
                    IsRead = table.Column<bool>(type: "tinyint(1)", nullable: false, comment: "WCS是否可以读取"),
                    SonTaskType = table.Column<int>(type: "int", nullable: true, comment: "子任务类型"),
                    SourceOrderNo = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "来源单据号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsNextTask = table.Column<int>(type: "int", nullable: true, comment: "下个任务是否生成成功"),
                    MutableParam1 = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "可变变量1")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MutableParam2 = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "可变变量2")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MutableParam3 = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true, comment: "可变变量3")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    Sort = table.Column<int>(type: "int", nullable: false, comment: "排序"),
                    IsDisabled = table.Column<bool>(type: "tinyint(1)", nullable: true, comment: "是否禁用"),
                    ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
                    CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
                    DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
                    DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_scms_wmstasks", x => x.Id);
                },
                comment: "任务表")
                .Annotation("MySql:CharSet", "utf8mb4");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsareas_AreaName",
                table: "scms_wmsareas",
@@ -263,6 +367,41 @@
                name: "IX_scms_wmscontainers_ContainerType",
                table: "scms_wmscontainers",
                column: "ContainerType");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsinoutstockrecords_ContainerNo",
                table: "scms_wmsinoutstockrecords",
                column: "ContainerNo");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsinoutstockrecords_MaterialId",
                table: "scms_wmsinoutstockrecords",
                column: "MaterialId");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsinoutstockrecords_MaterialNo",
                table: "scms_wmsinoutstockrecords",
                column: "MaterialNo");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsinoutstockrecords_OperateTime",
                table: "scms_wmsinoutstockrecords",
                column: "OperateTime");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsinoutstockrecords_OrderNo",
                table: "scms_wmsinoutstockrecords",
                column: "OrderNo");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsinoutstockrecords_StockType",
                table: "scms_wmsinoutstockrecords",
                column: "StockType");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsinoutstockrecords_TaskNo",
                table: "scms_wmsinoutstockrecords",
                column: "TaskNo");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsmaterials_MaterialCode",
@@ -310,6 +449,57 @@
                name: "IX_scms_wmsstores_StoreName",
                table: "scms_wmsstores",
                column: "StoreName");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmstasks_ContainerNo",
                table: "scms_wmstasks",
                column: "ContainerNo");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmstasks_DodeviceId",
                table: "scms_wmstasks",
                column: "DodeviceId");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmstasks_IsRead",
                table: "scms_wmstasks",
                column: "IsRead");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmstasks_Sort",
                table: "scms_wmstasks",
                column: "Sort");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmstasks_SourceOrderNo",
                table: "scms_wmstasks",
                column: "SourceOrderNo");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmstasks_SourcePlace",
                table: "scms_wmstasks",
                column: "SourcePlace");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmstasks_TaskNo",
                table: "scms_wmstasks",
                column: "TaskNo",
                unique: true);
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmstasks_TaskStatus",
                table: "scms_wmstasks",
                column: "TaskStatus");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmstasks_TaskType",
                table: "scms_wmstasks",
                column: "TaskType");
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmstasks_ToPlace",
                table: "scms_wmstasks",
                column: "ToPlace");
        }
        protected override void Down(MigrationBuilder migrationBuilder)
@@ -321,6 +511,9 @@
                name: "scms_wmscontainers");
            migrationBuilder.DropTable(
                name: "scms_wmsinoutstockrecords");
            migrationBuilder.DropTable(
                name: "scms_wmsmaterials");
            migrationBuilder.DropTable(
@@ -328,6 +521,9 @@
            migrationBuilder.DropTable(
                name: "scms_wmsstores");
            migrationBuilder.DropTable(
                name: "scms_wmstasks");
        }
    }
}