123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- namespace WCS.Service.Migrations
- {
- public partial class Init : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "WCS_CMD",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- DEVICE_CODE = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
- PROTOCOL = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
- PROPERTY = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true),
- VALUE = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
- WCSVERSION = 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)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_WCS_CMD", x => x.ID);
- });
- migrationBuilder.CreateTable(
- name: "WCS_DEVICE",
- columns: table => new
- {
- CODE = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
- NAME = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
- TYPE = table.Column<string>(type: "nvarchar(100)", maxLength: 100, 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)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_WCS_DEVICE", x => x.CODE);
- });
- migrationBuilder.CreateTable(
- name: "WCS_EXCEPTION",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- MSG = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
- STARTTIME = table.Column<DateTime>(type: "datetime2", nullable: false),
- TIMES = 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)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_WCS_EXCEPTION", x => x.ID);
- });
- migrationBuilder.CreateTable(
- name: "WCS_PLC",
- columns: table => new
- {
- CODE = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
- NAME = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
- IP = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
- PORT = table.Column<int>(type: "int", nullable: false),
- SLOT = table.Column<int>(type: "int", nullable: false),
- RACK = table.Column<int>(type: "int", nullable: false),
- TYPE = table.Column<int>(type: "int", nullable: false),
- MODEL = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true),
- 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)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_WCS_PLC", x => x.CODE);
- });
- migrationBuilder.CreateTable(
- name: "WCS_BCR80",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- CONTENT = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
- 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_BCR80", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_BCR80_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateTable(
- name: "WCS_RGV520",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- TaskID_1 = table.Column<int>(type: "int", nullable: false),
- TaskType_1 = table.Column<short>(type: "smallint", nullable: false),
- StartPosition_1 = table.Column<short>(type: "smallint", nullable: false),
- DestPosition_1 = table.Column<short>(type: "smallint", nullable: false),
- PRIORITY_1 = table.Column<short>(type: "smallint", nullable: false),
- RES1_1 = table.Column<short>(type: "smallint", nullable: false),
- RES2_1 = table.Column<short>(type: "smallint", nullable: false),
- Trigger_1 = table.Column<short>(type: "smallint", nullable: false),
- TaskID_2 = table.Column<int>(type: "int", nullable: false),
- TaskType_2 = table.Column<short>(type: "smallint", nullable: false),
- StartPosition_2 = table.Column<short>(type: "smallint", nullable: false),
- DestPosition_2 = table.Column<short>(type: "smallint", nullable: false),
- PRIORITY_2 = table.Column<short>(type: "smallint", nullable: false),
- RES1_2 = table.Column<short>(type: "smallint", nullable: false),
- RES2_2 = table.Column<short>(type: "smallint", nullable: false),
- Trigger_2 = table.Column<short>(type: "smallint", 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_RGV520", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_RGV520_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateTable(
- name: "WCS_RGV521",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- TaskID_1 = table.Column<int>(type: "int", nullable: false),
- TaskType_1 = table.Column<short>(type: "smallint", nullable: false),
- StartPosition_1 = table.Column<short>(type: "smallint", nullable: false),
- DestPosition_1 = table.Column<short>(type: "smallint", nullable: false),
- PRIORITY_1 = table.Column<short>(type: "smallint", nullable: false),
- ACT_V = table.Column<short>(type: "smallint", nullable: false),
- RES2_1 = table.Column<short>(type: "smallint", nullable: false),
- PH_Status_1 = table.Column<bool>(type: "bit", nullable: false),
- ToSition_1 = table.Column<bool>(type: "bit", nullable: false),
- Finish_1 = table.Column<bool>(type: "bit", nullable: false),
- TaskID_2 = table.Column<int>(type: "int", nullable: false),
- TaskType_2 = table.Column<short>(type: "smallint", nullable: false),
- StartPosition_2 = table.Column<short>(type: "smallint", nullable: false),
- DestPosition_2 = table.Column<short>(type: "smallint", nullable: false),
- PRIORITY_2 = table.Column<short>(type: "smallint", nullable: false),
- RES1_2 = table.Column<short>(type: "smallint", nullable: false),
- RES2_2 = table.Column<short>(type: "smallint", nullable: false),
- PH_Status_2 = table.Column<bool>(type: "bit", nullable: false),
- ToSition_2 = table.Column<bool>(type: "bit", nullable: false),
- Finish_2 = table.Column<bool>(type: "bit", nullable: false),
- SystemStatus = table.Column<short>(type: "smallint", nullable: false),
- WorkMode = table.Column<short>(type: "smallint", nullable: false),
- RES = table.Column<short>(type: "smallint", nullable: false),
- Position = table.Column<float>(type: "real", nullable: false),
- Mileage = table.Column<float>(type: "real", nullable: false),
- Runtime = table.Column<float>(type: "real", 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_RGV521", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_RGV521_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateTable(
- name: "WCS_RGV523",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Fault = table.Column<int>(type: "int", nullable: false),
- Fault1 = table.Column<int>(type: "int", nullable: false),
- Fault2 = table.Column<int>(type: "int", nullable: false),
- Status = table.Column<int>(type: "int", nullable: false),
- Status1 = table.Column<int>(type: "int", nullable: false),
- Status2 = 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_RGV523", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_RGV523_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateTable(
- name: "WCS_SC520",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Handshake = table.Column<short>(type: "smallint", nullable: false),
- Startnumber1 = table.Column<short>(type: "smallint", nullable: false),
- Endnumber2 = table.Column<short>(type: "smallint", nullable: false),
- GoodsType = table.Column<short>(type: "smallint", nullable: false),
- SpeedMode = table.Column<short>(type: "smallint", nullable: false),
- SLine = table.Column<short>(type: "smallint", nullable: false),
- SCol = table.Column<short>(type: "smallint", nullable: false),
- SLayer = table.Column<short>(type: "smallint", nullable: false),
- SDepth = table.Column<short>(type: "smallint", nullable: false),
- ELine = table.Column<short>(type: "smallint", nullable: false),
- ECol = table.Column<short>(type: "smallint", nullable: false),
- ELayer = table.Column<short>(type: "smallint", nullable: false),
- EDepth = table.Column<short>(type: "smallint", nullable: false),
- TaskID = table.Column<int>(type: "int", nullable: false),
- Trigger = table.Column<short>(type: "smallint", 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_SC520", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_SC520_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateTable(
- name: "WCS_SC521",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Handshake = table.Column<bool>(type: "bit", nullable: false),
- GetFinishi = table.Column<bool>(type: "bit", nullable: false),
- PutFinishi = table.Column<bool>(type: "bit", nullable: false),
- Alarm = table.Column<bool>(type: "bit", nullable: false),
- TaskFinishi = table.Column<bool>(type: "bit", nullable: false),
- Loaded = table.Column<bool>(type: "bit", nullable: false),
- ForkCenter = table.Column<bool>(type: "bit", nullable: false),
- RES = table.Column<byte>(type: "tinyint", nullable: false),
- Mode = table.Column<short>(type: "smallint", nullable: false),
- Status = table.Column<short>(type: "smallint", nullable: false),
- SLine = table.Column<short>(type: "smallint", nullable: false),
- SCol = table.Column<short>(type: "smallint", nullable: false),
- SLayer = table.Column<short>(type: "smallint", nullable: false),
- SDepth = table.Column<short>(type: "smallint", nullable: false),
- ELine = table.Column<short>(type: "smallint", nullable: false),
- ECol = table.Column<short>(type: "smallint", nullable: false),
- ELayer = table.Column<short>(type: "smallint", nullable: false),
- EDepth = table.Column<short>(type: "smallint", nullable: false),
- TaskID = table.Column<int>(type: "int", nullable: false),
- Trigger = table.Column<short>(type: "smallint", nullable: false),
- Line = table.Column<short>(type: "smallint", nullable: false),
- Col = table.Column<short>(type: "smallint", nullable: false),
- Layer = table.Column<short>(type: "smallint", nullable: false),
- FinishedTask = table.Column<int>(type: "int", nullable: false),
- TravelPos = table.Column<int>(type: "int", nullable: false),
- LiftPos = table.Column<int>(type: "int", nullable: false),
- ForkPos = table.Column<int>(type: "int", nullable: false),
- Startnumber1 = table.Column<short>(type: "smallint", nullable: false),
- Endnumber2 = table.Column<short>(type: "smallint", nullable: false),
- TotalKM = table.Column<float>(type: "real", nullable: false),
- GoodsType = table.Column<short>(type: "smallint", nullable: false),
- Runtime = table.Column<float>(type: "real", 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_SC521", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_SC521_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateTable(
- name: "WCS_SC537",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- SCAlarm = table.Column<decimal>(type: "decimal(20,0)", 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_SC537", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_SC537_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateTable(
- name: "WCS_STATION520",
- 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<short>(type: "smallint", nullable: false),
- GOODSTYPE = 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),
- WEIGHT = table.Column<short>(type: "smallint", nullable: false),
- FLAGS = table.Column<short>(type: "smallint", nullable: false),
- CONFIRM = table.Column<short>(type: "smallint", 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_STATION520", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_STATION520_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- });
- 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<short>(type: "smallint", nullable: false),
- GOODSTYPE = 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<bool>(type: "bit", nullable: false),
- RES = table.Column<bool>(type: "bit", nullable: false),
- RES1 = table.Column<bool>(type: "bit", nullable: false),
- RES2 = table.Column<bool>(type: "bit", nullable: false),
- PH_STATUS = table.Column<bool>(type: "bit", nullable: false),
- GOODS_ERR = table.Column<bool>(type: "bit", nullable: false),
- F_OUTSIDE = table.Column<bool>(type: "bit", nullable: false),
- B_OUTSIDE = table.Column<bool>(type: "bit", nullable: false),
- L_OUTSIDE = table.Column<bool>(type: "bit", nullable: false),
- R_OUTSIDE = table.Column<bool>(type: "bit", nullable: false),
- H_OUTSIDE = table.Column<bool>(type: "bit", nullable: false),
- BCR_NOREAD = table.Column<bool>(type: "bit", nullable: false),
- OVERLOAD = table.Column<bool>(type: "bit", nullable: false),
- RES3 = table.Column<bool>(type: "bit", nullable: false),
- RES4 = table.Column<bool>(type: "bit", nullable: false),
- RES5 = table.Column<bool>(type: "bit", nullable: false),
- WEIGHT = 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",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateTable(
- name: "WCS_STATION523",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Fault = table.Column<int>(type: "int", nullable: false),
- RES = table.Column<int>(type: "int", nullable: false),
- Status = table.Column<short>(type: "smallint", nullable: false),
- RunTime = table.Column<float>(type: "real", 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_STATION523", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_STATION523_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateTable(
- name: "WCS_DATABLOCK",
- columns: table => new
- {
- CODE = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
- NAME = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
- PLCCODE = table.Column<string>(type: "nvarchar(20)", nullable: true),
- NO = table.Column<int>(type: "int", nullable: false),
- LENGTH = table.Column<int>(type: "int", nullable: false),
- DATALENGTH = table.Column<int>(type: "int", nullable: false),
- PROTOCOL = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
- NOUPDATE = table.Column<bool>(type: "bit", 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)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_WCS_DATABLOCK", x => x.CODE);
- table.ForeignKey(
- name: "FK_WCS_DATABLOCK_WCS_PLC_PLCCODE",
- column: x => x.PLCCODE,
- principalTable: "WCS_PLC",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateTable(
- name: "WCS_DEVICEPROTOCOL",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: false),
- DBCODE = table.Column<string>(type: "nvarchar(20)", nullable: true),
- POSITION = table.Column<short>(type: "smallint", 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)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_WCS_DEVICEPROTOCOL", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_DEVICEPROTOCOL_WCS_DATABLOCK_DBCODE",
- column: x => x.DBCODE,
- principalTable: "WCS_DATABLOCK",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- table.ForeignKey(
- name: "FK_WCS_DEVICEPROTOCOL_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Cascade);
- });
- migrationBuilder.CreateIndex(
- name: "IX_WCS_BCR80_DEVICECODE",
- table: "WCS_BCR80",
- column: "DEVICECODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_DATABLOCK_PLCCODE",
- table: "WCS_DATABLOCK",
- column: "PLCCODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_DEVICEPROTOCOL_DBCODE",
- table: "WCS_DEVICEPROTOCOL",
- column: "DBCODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_DEVICEPROTOCOL_DEVICECODE",
- table: "WCS_DEVICEPROTOCOL",
- column: "DEVICECODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_RGV520_DEVICECODE",
- table: "WCS_RGV520",
- column: "DEVICECODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_RGV521_DEVICECODE",
- table: "WCS_RGV521",
- column: "DEVICECODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_RGV523_DEVICECODE",
- table: "WCS_RGV523",
- column: "DEVICECODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_SC520_DEVICECODE",
- table: "WCS_SC520",
- column: "DEVICECODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_SC521_DEVICECODE",
- table: "WCS_SC521",
- column: "DEVICECODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_SC537_DEVICECODE",
- table: "WCS_SC537",
- column: "DEVICECODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_STATION520_DEVICECODE",
- table: "WCS_STATION520",
- column: "DEVICECODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_STATION521_DEVICECODE",
- table: "WCS_STATION521",
- column: "DEVICECODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_STATION523_DEVICECODE",
- table: "WCS_STATION523",
- column: "DEVICECODE");
- }
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "WCS_BCR80");
- migrationBuilder.DropTable(
- name: "WCS_CMD");
- migrationBuilder.DropTable(
- name: "WCS_DEVICEPROTOCOL");
- migrationBuilder.DropTable(
- name: "WCS_EXCEPTION");
- migrationBuilder.DropTable(
- name: "WCS_RGV520");
- migrationBuilder.DropTable(
- name: "WCS_RGV521");
- migrationBuilder.DropTable(
- name: "WCS_RGV523");
- migrationBuilder.DropTable(
- name: "WCS_SC520");
- migrationBuilder.DropTable(
- name: "WCS_SC521");
- migrationBuilder.DropTable(
- name: "WCS_SC537");
- migrationBuilder.DropTable(
- name: "WCS_STATION520");
- migrationBuilder.DropTable(
- name: "WCS_STATION521");
- migrationBuilder.DropTable(
- name: "WCS_STATION523");
- migrationBuilder.DropTable(
- name: "WCS_DATABLOCK");
- migrationBuilder.DropTable(
- name: "WCS_DEVICE");
- migrationBuilder.DropTable(
- name: "WCS_PLC");
- }
- }
- }
|