zs
2025-05-15 edba4ede85a3d82a7f0a0a7dccddbc8281862888
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
using System;
using Microsoft.EntityFrameworkCore.Migrations;
 
#nullable disable
 
namespace CMS.Plugin.HIAWms.MySQL.Migrations
{
    public partial class InitialCreate2 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "scms_wmsmaterialinfos",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    MaterialNo = 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: false, comment: "物料名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MaterialModel = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "机型/规格")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MaterialId = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "物料唯一码")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    StockNumber = table.Column<int>(type: "int", nullable: true, comment: "库存数量"),
                    MaterialBatch = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "物料批号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    SupplierCode = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true, comment: "供应商编号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CheckStatus = table.Column<int>(type: "int", nullable: true, comment: "检验状态(0:未检验,1:检验通过,2:检验不通过)"),
                    RedundantField1 = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "冗余字段1")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    RedundantField2 = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "冗余字段2")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    RedundantField3 = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true, comment: "冗余字段3")
                        .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, 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_wmsmaterialinfos", x => x.Id);
                },
                comment: "WMS物料信息表")
                .Annotation("MySql:CharSet", "utf8mb4");
 
            migrationBuilder.CreateTable(
                name: "scms_wmsmaterialstocks",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    MaterialId = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "物料ID")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MaterialName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false, comment: "物料名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ContainerNo = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true, comment: "容器编号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ContainerStatus = table.Column<int>(type: "int", nullable: false, comment: "容器状态"),
                    ContainerType = table.Column<int>(type: "int", nullable: false, comment: "容器类型"),
                    MaterialNo = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false, comment: "物料编号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    StockNumber = table.Column<int>(type: "int", nullable: false, comment: "库存数量"),
                    MaterialBatch = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true, comment: "物料批次")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    SupplierCode = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true, comment: "供应商编号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    MaterialModel = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true, comment: "机型/规格")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    PlaceNo = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true, comment: "库位编号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    PlaceStatus = table.Column<int>(type: "int", nullable: false, comment: "库位状态;"),
                    StorageTypeNo = table.Column<int>(type: "int", nullable: false, comment: "库位类型"),
                    AreaCode = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true, comment: "区域编号")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    AreaName = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: true, comment: "库区名称")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    CheckStatus = table.Column<int>(type: "int", nullable: true, comment: "检验状态(1:未检验,2:检验通过,3:检验不通过)"),
                    IsLock = table.Column<int>(type: "int", nullable: false, comment: "是否锁定(2:未锁定,1:已锁定)"),
                    EmptyContainer = table.Column<int>(type: "int", nullable: false, comment: "是否空托(2:否,1:是)"),
                    InStockTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "入库时间"),
                    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"),
                    RedundantField1 = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "冗余字段1 - 预留扩展用途")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    RedundantField2 = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "冗余字段2 - 预留扩展用途")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    RedundantField3 = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "冗余字段3 - 预留扩展用途")
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    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_wmsmaterialstocks", x => x.Id);
                },
                comment: "WMS物料库存表")
                .Annotation("MySql:CharSet", "utf8mb4");
 
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsmaterialinfos_CheckStatus",
                table: "scms_wmsmaterialinfos",
                column: "CheckStatus");
 
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsmaterialinfos_MaterialBatch",
                table: "scms_wmsmaterialinfos",
                column: "MaterialBatch");
 
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsmaterialinfos_MaterialId",
                table: "scms_wmsmaterialinfos",
                column: "MaterialId",
                unique: true);
 
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsmaterialinfos_MaterialName",
                table: "scms_wmsmaterialinfos",
                column: "MaterialName");
 
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsmaterialinfos_MaterialNo",
                table: "scms_wmsmaterialinfos",
                column: "MaterialNo",
                unique: true);
 
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsmaterialinfos_SupplierCode",
                table: "scms_wmsmaterialinfos",
                column: "SupplierCode");
 
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsmaterialstocks_AreaCode",
                table: "scms_wmsmaterialstocks",
                column: "AreaCode");
 
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsmaterialstocks_ContainerNo",
                table: "scms_wmsmaterialstocks",
                column: "ContainerNo");
 
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsmaterialstocks_MaterialBatch_SupplierCode",
                table: "scms_wmsmaterialstocks",
                columns: new[] { "MaterialBatch", "SupplierCode" });
 
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsmaterialstocks_MaterialName",
                table: "scms_wmsmaterialstocks",
                column: "MaterialName");
 
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsmaterialstocks_MaterialNo",
                table: "scms_wmsmaterialstocks",
                column: "MaterialNo",
                unique: true);
 
            migrationBuilder.CreateIndex(
                name: "IX_scms_wmsmaterialstocks_PlaceNo",
                table: "scms_wmsmaterialstocks",
                column: "PlaceNo");
        }
 
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "scms_wmsmaterialinfos");
 
            migrationBuilder.DropTable(
                name: "scms_wmsmaterialstocks");
        }
    }
}