You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
508 lines
34 KiB
508 lines
34 KiB
4 years ago
|
using System;
|
||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||
|
|
||
|
namespace Win.Sfs.SettleAccount.Migrations
|
||
|
{
|
||
|
public partial class initail : Migration
|
||
|
{
|
||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||
|
{
|
||
|
migrationBuilder.CreateTable(
|
||
|
name: "Set_Invoice",
|
||
|
columns: table => new
|
||
|
{
|
||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Year = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
Period = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
Version = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
Factory = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
MaterialCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||
|
MaterialDesc = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||
|
Amt = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||
|
Extend = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
|
||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||
|
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Enabled = table.Column<bool>(type: "bit", nullable: false),
|
||
|
Remark = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true)
|
||
|
},
|
||
|
constraints: table =>
|
||
|
{
|
||
|
table.PrimaryKey("PK_Set_Invoice", x => x.Id);
|
||
|
});
|
||
|
|
||
|
migrationBuilder.CreateTable(
|
||
|
name: "Set_InvoiceVersion",
|
||
|
columns: table => new
|
||
|
{
|
||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Year = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
Period = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
Version = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
CustomerCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
|
||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||
|
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Enabled = table.Column<bool>(type: "bit", nullable: false),
|
||
|
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||
|
},
|
||
|
constraints: table =>
|
||
|
{
|
||
|
table.PrimaryKey("PK_Set_InvoiceVersion", x => x.Id);
|
||
|
});
|
||
|
|
||
|
migrationBuilder.CreateTable(
|
||
|
name: "Set_KanBanSettle",
|
||
|
columns: table => new
|
||
|
{
|
||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Year = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
Period = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
Version = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
Kanban = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
|
||
|
Relation = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||
|
Factory = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
MaterialCode = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
|
||
|
PartType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
SupplierCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
SettleInputDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
Batch = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
Flag = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||
|
SettleDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
State = table.Column<int>(type: "int", nullable: false),
|
||
|
Extend = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
|
||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||
|
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Enabled = table.Column<bool>(type: "bit", nullable: false),
|
||
|
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||
|
},
|
||
|
constraints: table =>
|
||
|
{
|
||
|
table.PrimaryKey("PK_Set_KanBanSettle", x => x.Id);
|
||
|
});
|
||
|
|
||
|
migrationBuilder.CreateTable(
|
||
|
name: "Set_KanBanSettle_Version",
|
||
|
columns: table => new
|
||
|
{
|
||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Year = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
Period = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
Version = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
CustomerCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
|
||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
|
||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||
|
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Enabled = table.Column<bool>(type: "bit", nullable: false),
|
||
|
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||
|
},
|
||
|
constraints: table =>
|
||
|
{
|
||
|
table.PrimaryKey("PK_Set_KanBanSettle_Version", x => x.Id);
|
||
|
});
|
||
|
|
||
|
migrationBuilder.CreateTable(
|
||
|
name: "Set_ScrapClaims",
|
||
|
columns: table => new
|
||
|
{
|
||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Year = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
Period = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
Version = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
Type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||
|
MaterialCode = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||
|
MaterialDesc = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||
|
Amt = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||
|
Extend = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
|
||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||
|
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Enabled = table.Column<bool>(type: "bit", nullable: false),
|
||
|
Remark = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true)
|
||
|
},
|
||
|
constraints: table =>
|
||
|
{
|
||
|
table.PrimaryKey("PK_Set_ScrapClaims", x => x.Id);
|
||
|
});
|
||
|
|
||
|
migrationBuilder.CreateTable(
|
||
|
name: "Set_ScrapClaims_Version",
|
||
|
columns: table => new
|
||
|
{
|
||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Year = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
Period = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
Version = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
CustomerCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
|
||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
|
||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||
|
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Enabled = table.Column<bool>(type: "bit", nullable: false),
|
||
|
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||
|
},
|
||
|
constraints: table =>
|
||
|
{
|
||
|
table.PrimaryKey("PK_Set_ScrapClaims_Version", x => x.Id);
|
||
|
});
|
||
|
|
||
|
migrationBuilder.CreateTable(
|
||
|
name: "Set_Settle",
|
||
|
columns: table => new
|
||
|
{
|
||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Year = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
|
||
|
Period = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
|
||
|
SettleYear = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
KENNCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
ChassisNumber = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
Model = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
CP5A = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
CP7 = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
MaterialCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||
|
SettlementID = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
SettlementSupplier = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
state = table.Column<int>(type: "int", nullable: false),
|
||
|
Version = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
|
||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||
|
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Enabled = table.Column<bool>(type: "bit", nullable: false),
|
||
|
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||
|
},
|
||
|
constraints: table =>
|
||
|
{
|
||
|
table.PrimaryKey("PK_Set_Settle", x => x.Id);
|
||
|
});
|
||
|
|
||
|
migrationBuilder.CreateTable(
|
||
|
name: "Set_Settle_Version",
|
||
|
columns: table => new
|
||
|
{
|
||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Year = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
Period = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
Version = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
CustomerCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
|
||
|
Factory = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
|
||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||
|
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Enabled = table.Column<bool>(type: "bit", nullable: false),
|
||
|
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||
|
},
|
||
|
constraints: table =>
|
||
|
{
|
||
|
table.PrimaryKey("PK_Set_Settle_Version", x => x.Id);
|
||
|
});
|
||
|
|
||
|
migrationBuilder.CreateTable(
|
||
|
name: "Set_SparePart",
|
||
|
columns: table => new
|
||
|
{
|
||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Year = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
|
||
|
Period = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
|
||
|
Version = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
|
||
|
LineNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
PurchaseType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
PurchaseOrderNo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||
|
PurchaseOrderNoItem = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
PurchaseOrderNoText = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
ReceiptQty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||
|
InvoicedQty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||
|
AmountNoTax = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||
|
PurchasePriceNoTax = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||
|
AccountNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
MaterialCode = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false),
|
||
|
MaterialDesc = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
SpareDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
DeliveryOrderNo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
||
|
DeliveryLineNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
BatchNo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
Unit = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
TaxRate = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||
|
TaxCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
GermanInvoiceNo = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||
|
Factory = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
FactoryName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||
|
Extend = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: true),
|
||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
|
||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||
|
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Enabled = table.Column<bool>(type: "bit", nullable: false),
|
||
|
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||
|
},
|
||
|
constraints: table =>
|
||
|
{
|
||
|
table.PrimaryKey("PK_Set_SparePart", x => x.Id);
|
||
|
});
|
||
|
|
||
|
migrationBuilder.CreateTable(
|
||
|
name: "Set_SparePart_Version",
|
||
|
columns: table => new
|
||
|
{
|
||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Year = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
Period = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
Version = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
CustomerCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
|
||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
|
||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||
|
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Enabled = table.Column<bool>(type: "bit", nullable: false),
|
||
|
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||
|
},
|
||
|
constraints: table =>
|
||
|
{
|
||
|
table.PrimaryKey("PK_Set_SparePart_Version", x => x.Id);
|
||
|
});
|
||
|
|
||
|
migrationBuilder.CreateTable(
|
||
|
name: "Set_Unsettle",
|
||
|
columns: table => new
|
||
|
{
|
||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Year = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
|
||
|
Period = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
|
||
|
SettleYear = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
KENNCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
ChassisNumber = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
Model = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
CP5A = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
CP7 = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
MaterialCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
|
||
|
SettlementID = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
SettlementSupplier = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
state = table.Column<int>(type: "int", nullable: false),
|
||
|
UnsettledReason = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
Version = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
|
||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||
|
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Enabled = table.Column<bool>(type: "bit", nullable: false),
|
||
|
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||
|
},
|
||
|
constraints: table =>
|
||
|
{
|
||
|
table.PrimaryKey("PK_Set_Unsettle", x => x.Id);
|
||
|
});
|
||
|
|
||
|
migrationBuilder.CreateTable(
|
||
|
name: "Set_Unsettle_Version",
|
||
|
columns: table => new
|
||
|
{
|
||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Year = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
Period = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
Version = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: false),
|
||
|
CustomerCode = table.Column<string>(type: "nvarchar(36)", maxLength: 36, nullable: true),
|
||
|
Factory = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
|
||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||
|
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||
|
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||
|
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||
|
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||
|
Enabled = table.Column<bool>(type: "bit", nullable: false),
|
||
|
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||
|
},
|
||
|
constraints: table =>
|
||
|
{
|
||
|
table.PrimaryKey("PK_Set_Unsettle_Version", x => x.Id);
|
||
|
});
|
||
|
|
||
|
migrationBuilder.CreateIndex(
|
||
|
name: "IX_Set_KanBanSettle_Kanban_MaterialCode",
|
||
|
table: "Set_KanBanSettle",
|
||
|
columns: new[] { "Kanban", "MaterialCode" },
|
||
|
unique: true,
|
||
|
filter: "IsDeleted=0");
|
||
|
|
||
|
migrationBuilder.CreateIndex(
|
||
|
name: "IX_Set_KanBanSettle_Version_Version",
|
||
|
table: "Set_KanBanSettle_Version",
|
||
|
column: "Version",
|
||
|
unique: true,
|
||
|
filter: "IsDeleted=0");
|
||
|
|
||
|
migrationBuilder.CreateIndex(
|
||
|
name: "IX_Set_ScrapClaims_Version_Version",
|
||
|
table: "Set_ScrapClaims_Version",
|
||
|
column: "Version",
|
||
|
unique: true,
|
||
|
filter: "IsDeleted=0");
|
||
|
|
||
|
migrationBuilder.CreateIndex(
|
||
|
name: "IX_Set_Settle_state",
|
||
|
table: "Set_Settle",
|
||
|
column: "state");
|
||
|
|
||
|
migrationBuilder.CreateIndex(
|
||
|
name: "IX_Set_Settle_Version_ChassisNumber_MaterialCode_KENNCode",
|
||
|
table: "Set_Settle",
|
||
|
columns: new[] { "Version", "ChassisNumber", "MaterialCode", "KENNCode" });
|
||
|
|
||
|
migrationBuilder.CreateIndex(
|
||
|
name: "IX_Set_Settle_Version_Version",
|
||
|
table: "Set_Settle_Version",
|
||
|
column: "Version",
|
||
|
unique: true,
|
||
|
filter: "IsDeleted=0");
|
||
|
|
||
|
migrationBuilder.CreateIndex(
|
||
|
name: "IX_Set_SparePart_Version_Version",
|
||
|
table: "Set_SparePart_Version",
|
||
|
column: "Version",
|
||
|
unique: true,
|
||
|
filter: "IsDeleted=0");
|
||
|
|
||
|
migrationBuilder.CreateIndex(
|
||
|
name: "IX_Set_Unsettle_state",
|
||
|
table: "Set_Unsettle",
|
||
|
column: "state");
|
||
|
|
||
|
migrationBuilder.CreateIndex(
|
||
|
name: "IX_Set_Unsettle_Version_ChassisNumber_MaterialCode",
|
||
|
table: "Set_Unsettle",
|
||
|
columns: new[] { "Version", "ChassisNumber", "MaterialCode" },
|
||
|
unique: true);
|
||
|
|
||
|
migrationBuilder.CreateIndex(
|
||
|
name: "IX_Set_Unsettle_Version_Version",
|
||
|
table: "Set_Unsettle_Version",
|
||
|
column: "Version",
|
||
|
unique: true,
|
||
|
filter: "IsDeleted=0");
|
||
|
}
|
||
|
|
||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||
|
{
|
||
|
migrationBuilder.DropTable(
|
||
|
name: "Set_Invoice");
|
||
|
|
||
|
migrationBuilder.DropTable(
|
||
|
name: "Set_InvoiceVersion");
|
||
|
|
||
|
migrationBuilder.DropTable(
|
||
|
name: "Set_KanBanSettle");
|
||
|
|
||
|
migrationBuilder.DropTable(
|
||
|
name: "Set_KanBanSettle_Version");
|
||
|
|
||
|
migrationBuilder.DropTable(
|
||
|
name: "Set_ScrapClaims");
|
||
|
|
||
|
migrationBuilder.DropTable(
|
||
|
name: "Set_ScrapClaims_Version");
|
||
|
|
||
|
migrationBuilder.DropTable(
|
||
|
name: "Set_Settle");
|
||
|
|
||
|
migrationBuilder.DropTable(
|
||
|
name: "Set_Settle_Version");
|
||
|
|
||
|
migrationBuilder.DropTable(
|
||
|
name: "Set_SparePart");
|
||
|
|
||
|
migrationBuilder.DropTable(
|
||
|
name: "Set_SparePart_Version");
|
||
|
|
||
|
migrationBuilder.DropTable(
|
||
|
name: "Set_Unsettle");
|
||
|
|
||
|
migrationBuilder.DropTable(
|
||
|
name: "Set_Unsettle_Version");
|
||
|
}
|
||
|
}
|
||
|
}
|