123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace WCS.Service.Migrations
- {
- public partial class _3 : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_WCS_STATION50_WCS_DEVICE_DEVICECODE",
- table: "WCS_STATION50");
- migrationBuilder.DropForeignKey(
- name: "FK_WCS_STATION70_WCS_DEVICE_DEVICECODE",
- table: "WCS_STATION70");
- migrationBuilder.DropPrimaryKey(
- name: "PK_WCS_STATION70",
- table: "WCS_STATION70");
- migrationBuilder.DropPrimaryKey(
- name: "PK_WCS_STATION50",
- table: "WCS_STATION50");
- migrationBuilder.RenameTable(
- name: "WCS_STATION70",
- newName: "WCS_STATION523");
- migrationBuilder.RenameTable(
- name: "WCS_STATION50",
- newName: "WCS_STATION520");
- migrationBuilder.RenameIndex(
- name: "IX_WCS_STATION70_DEVICECODE",
- table: "WCS_STATION523",
- newName: "IX_WCS_STATION523_DEVICECODE");
- migrationBuilder.RenameIndex(
- name: "IX_WCS_STATION50_DEVICECODE",
- table: "WCS_STATION520",
- newName: "IX_WCS_STATION520_DEVICECODE");
- migrationBuilder.AddPrimaryKey(
- name: "PK_WCS_STATION523",
- table: "WCS_STATION523",
- column: "ID");
- migrationBuilder.AddPrimaryKey(
- name: "PK_WCS_STATION520",
- table: "WCS_STATION520",
- column: "ID");
- migrationBuilder.CreateTable(
- name: "WCS_STATION521",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Tasknum = table.Column<int>(type: "int", nullable: false),
- Goodscode = table.Column<int>(type: "int", nullable: false),
- Goodsnum = table.Column<short>(type: "smallint", nullable: false),
- GoodsSize = table.Column<short>(type: "smallint", nullable: false),
- Goodsstart = table.Column<short>(type: "smallint", nullable: false),
- Goodsend = table.Column<short>(type: "smallint", nullable: false),
- Request = table.Column<short>(type: "smallint", nullable: false),
- CmdType = table.Column<short>(type: "smallint", nullable: false),
- VoucherNo = table.Column<short>(type: "smallint", nullable: false),
- Istation521Status = table.Column<int>(type: "int", nullable: false),
- ENABLED = table.Column<bool>(type: "bit", nullable: false),
- UPDATEUSER = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
- UPDATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
- VER = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: true),
- DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
- FRAME = table.Column<DateTime>(type: "datetime2", nullable: false),
- ISLAST = table.Column<bool>(type: "bit", nullable: false),
- WCSVERSION = table.Column<int>(type: "int", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_WCS_STATION521", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_STATION521_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE");
- });
- migrationBuilder.CreateIndex(
- name: "IX_WCS_STATION521_DEVICECODE",
- table: "WCS_STATION521",
- column: "DEVICECODE");
- migrationBuilder.AddForeignKey(
- name: "FK_WCS_STATION520_WCS_DEVICE_DEVICECODE",
- table: "WCS_STATION520",
- column: "DEVICECODE",
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE");
- migrationBuilder.AddForeignKey(
- name: "FK_WCS_STATION523_WCS_DEVICE_DEVICECODE",
- table: "WCS_STATION523",
- column: "DEVICECODE",
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE");
- }
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_WCS_STATION520_WCS_DEVICE_DEVICECODE",
- table: "WCS_STATION520");
- migrationBuilder.DropForeignKey(
- name: "FK_WCS_STATION523_WCS_DEVICE_DEVICECODE",
- table: "WCS_STATION523");
- migrationBuilder.DropTable(
- name: "WCS_STATION521");
- migrationBuilder.DropPrimaryKey(
- name: "PK_WCS_STATION523",
- table: "WCS_STATION523");
- migrationBuilder.DropPrimaryKey(
- name: "PK_WCS_STATION520",
- table: "WCS_STATION520");
- migrationBuilder.RenameTable(
- name: "WCS_STATION523",
- newName: "WCS_STATION70");
- migrationBuilder.RenameTable(
- name: "WCS_STATION520",
- newName: "WCS_STATION50");
- migrationBuilder.RenameIndex(
- name: "IX_WCS_STATION523_DEVICECODE",
- table: "WCS_STATION70",
- newName: "IX_WCS_STATION70_DEVICECODE");
- migrationBuilder.RenameIndex(
- name: "IX_WCS_STATION520_DEVICECODE",
- table: "WCS_STATION50",
- newName: "IX_WCS_STATION50_DEVICECODE");
- migrationBuilder.AddPrimaryKey(
- name: "PK_WCS_STATION70",
- table: "WCS_STATION70",
- column: "ID");
- migrationBuilder.AddPrimaryKey(
- name: "PK_WCS_STATION50",
- table: "WCS_STATION50",
- column: "ID");
- migrationBuilder.AddForeignKey(
- name: "FK_WCS_STATION50_WCS_DEVICE_DEVICECODE",
- table: "WCS_STATION50",
- column: "DEVICECODE",
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE");
- migrationBuilder.AddForeignKey(
- name: "FK_WCS_STATION70_WCS_DEVICE_DEVICECODE",
- table: "WCS_STATION70",
- column: "DEVICECODE",
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE");
- }
- }
- }
|