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");
|
}
|
}
|
}
|