wanggang
1 year ago
7 changed files with 4674 additions and 16 deletions
File diff suppressed because it is too large
@ -0,0 +1,173 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.Migrations |
||||
|
{ |
||||
|
public partial class vmi : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "Set_JobItem", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false), |
||||
|
Cron = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false), |
||||
|
Service = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false), |
||||
|
IsRunning = table.Column<bool>(type: "bit", nullable: false), |
||||
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_Set_JobItem", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "Set_VmiBalance", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
LU = table.Column<string>(type: "nvarchar(450)", nullable: false), |
||||
|
PN = table.Column<string>(type: "nvarchar(450)", nullable: false), |
||||
|
PNType = table.Column<int>(type: "int", nullable: false), |
||||
|
Type = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
Qty = table.Column<decimal>(type: "decimal(18,2)", nullable: false) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_Set_VmiBalance", x => x.Id); |
||||
|
table.UniqueConstraint("AK_Set_VmiBalance_PN_LU", x => new { x.PN, x.LU }); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "Set_VmiCategory", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
Type = table.Column<int>(type: "int", nullable: false), |
||||
|
Number = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false), |
||||
|
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_Set_VmiCategory", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "Set_VmiSnapshot", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
Path = table.Column<string>(type: "nvarchar(max)", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_Set_VmiSnapshot", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "JobLog", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
JobId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
||||
|
Start = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
End = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
Success = table.Column<bool>(type: "bit", nullable: false), |
||||
|
Exception = table.Column<string>(type: "nvarchar(max)", nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_JobLog", x => x.Id); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_JobLog_Set_JobItem_JobId", |
||||
|
column: x => x.JobId, |
||||
|
principalTable: "Set_JobItem", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.SetNull); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "Set_VmiLog", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
CategoryId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
BalanceId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
SessionId = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
Type = table.Column<int>(type: "int", nullable: false) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_Set_VmiLog", x => x.Id); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_Set_VmiLog_Set_VmiBalance_BalanceId", |
||||
|
column: x => x.BalanceId, |
||||
|
principalTable: "Set_VmiBalance", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_Set_VmiLog_Set_VmiCategory_CategoryId", |
||||
|
column: x => x.CategoryId, |
||||
|
principalTable: "Set_VmiCategory", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.InsertData( |
||||
|
table: "Set_JobItem", |
||||
|
columns: new[] { "Id", "ConcurrencyStamp", "Cron", "IsRunning", "Name", "Service" }, |
||||
|
values: new object[] { new Guid("a6d57042-e087-421e-a086-dfb34c6bfe80"), null, "0 0 8 26 *", false, "库存快照", "Win.Sfs.SettleAccount.Entities.BQ.VmiService" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_JobLog_JobId", |
||||
|
table: "JobLog", |
||||
|
column: "JobId"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_Set_JobItem_Name", |
||||
|
table: "Set_JobItem", |
||||
|
column: "Name", |
||||
|
unique: true); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_Set_VmiCategory_Number", |
||||
|
table: "Set_VmiCategory", |
||||
|
column: "Number", |
||||
|
unique: true); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_Set_VmiLog_BalanceId", |
||||
|
table: "Set_VmiLog", |
||||
|
column: "BalanceId"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_Set_VmiLog_CategoryId", |
||||
|
table: "Set_VmiLog", |
||||
|
column: "CategoryId"); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropTable( |
||||
|
name: "JobLog"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "Set_VmiLog"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "Set_VmiSnapshot"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "Set_JobItem"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "Set_VmiBalance"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "Set_VmiCategory"); |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue