using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win_in.Sfs.Basedata.Migrations { public partial class _202249 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Basedata_LocationItem"); migrationBuilder.AddColumn( name: "AltUm", table: "Basedata_ItemStoreRelation", type: "nvarchar(64)", maxLength: 64, nullable: true); migrationBuilder.AddColumn( name: "AltUmQty", table: "Basedata_ItemStoreRelation", type: "decimal(18,2)", nullable: false, defaultValue: 0m); migrationBuilder.AddColumn( name: "IsFixed", table: "Basedata_ItemStoreRelation", type: "bit", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "MultiLoc", table: "Basedata_ItemStoreRelation", type: "int", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "PramaryUM", table: "Basedata_ItemStoreRelation", type: "nvarchar(64)", maxLength: 64, nullable: true); migrationBuilder.AddColumn( name: "StoreUM", table: "Basedata_ItemStoreRelation", type: "nvarchar(64)", maxLength: 64, nullable: true); migrationBuilder.AddColumn( name: "UmQty", table: "Basedata_ItemStoreRelation", type: "decimal(18,2)", nullable: false, defaultValue: 0m); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "AltUm", table: "Basedata_ItemStoreRelation"); migrationBuilder.DropColumn( name: "AltUmQty", table: "Basedata_ItemStoreRelation"); migrationBuilder.DropColumn( name: "IsFixed", table: "Basedata_ItemStoreRelation"); migrationBuilder.DropColumn( name: "MultiLoc", table: "Basedata_ItemStoreRelation"); migrationBuilder.DropColumn( name: "PramaryUM", table: "Basedata_ItemStoreRelation"); migrationBuilder.DropColumn( name: "StoreUM", table: "Basedata_ItemStoreRelation"); migrationBuilder.DropColumn( name: "UmQty", table: "Basedata_ItemStoreRelation"); migrationBuilder.CreateTable( name: "Basedata_LocationItem", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), Company = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ItemCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), LocationCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), Remark = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), TenantId = table.Column(type: "uniqueidentifier", nullable: true), WarehouseCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false) }, constraints: table => { table.PrimaryKey("PK_Basedata_LocationItem", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_Basedata_LocationItem_ItemCode_LocationCode_WarehouseCode_Company", table: "Basedata_LocationItem", columns: new[] { "ItemCode", "LocationCode", "WarehouseCode", "Company" }, unique: true); } } }