123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace WCS.Service.Migrations
- {
- public partial class _1 : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "WCS_AGVTask",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- AGVID = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
- TaskType = table.Column<int>(type: "int", nullable: false),
- Status = table.Column<int>(type: "int", nullable: false),
- AGVStatus = table.Column<int>(type: "int", nullable: false),
- Workshop = table.Column<int>(type: "int", nullable: false),
- Station = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
- Position = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
- CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
- UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
- AGVUpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_WCS_AGVTask", x => x.ID);
- });
- 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),
- 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_MAPPINGENTRY",
- columns: table => new
- {
- MEP_ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- MEP_MAPPINGNO = table.Column<int>(type: "int", nullable: false),
- MEP_MAPPINGTYPE = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
- MEP_MAPPINGCHNAME = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
- MEP_ISSTOP = table.Column<bool>(type: "bit", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_WCS_MAPPINGENTRY", x => x.MEP_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_StatusLog",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- WCS_TASKID = table.Column<int>(type: "int", nullable: false),
- NewStatus = table.Column<int>(type: "int", nullable: false),
- OldStatus = table.Column<int>(type: "int", nullable: false),
- upStatus = table.Column<int>(type: "int", nullable: false),
- Node = table.Column<string>(type: "nvarchar(max)", 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_StatusLog", x => x.ID);
- });
- migrationBuilder.CreateTable(
- name: "WCS_SystemConfig",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Code = table.Column<string>(type: "nvarchar(max)", nullable: false),
- Describe = table.Column<string>(type: "nvarchar(max)", nullable: false),
- DEVICECODE = table.Column<string>(type: "nvarchar(max)", nullable: false),
- TUNNEL = table.Column<string>(type: "nvarchar(max)", nullable: false),
- Direction = table.Column<string>(type: "nvarchar(max)", 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_SystemConfig", x => x.ID);
- });
- migrationBuilder.CreateTable(
- name: "WCS_TASK",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- BARCODE = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
- TYPE = table.Column<int>(type: "int", nullable: false),
- STATUS = table.Column<int>(type: "int", nullable: false),
- ADDRFROM = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
- ADDRTO = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
- ADDRNEXT = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
- TUNNEL = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
- FLOOR = table.Column<int>(type: "int", nullable: false),
- DEVICE = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
- SCSTATION = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
- CREATETIME = table.Column<DateTime>(type: "datetime2", nullable: false),
- STARTTIME = table.Column<DateTime>(type: "datetime2", nullable: true),
- ENDTIME = table.Column<DateTime>(type: "datetime2", nullable: true),
- DOCID = table.Column<int>(type: "int", nullable: false),
- PALLETTYPE = table.Column<short>(type: "smallint", nullable: false),
- PRODLINE = table.Column<short>(type: "smallint", nullable: false),
- FULLQTY = table.Column<short>(type: "smallint", nullable: false),
- HEIGHT = table.Column<short>(type: "smallint", nullable: false),
- WMSTASK = table.Column<int>(type: "int", nullable: false),
- TaskGroupKey = table.Column<string>(type: "nvarchar(max)", nullable: false),
- UPLOADED = table.Column<int>(type: "int", nullable: false),
- AgvTask = table.Column<int>(type: "int", nullable: false),
- Priority = table.Column<int>(type: "int", nullable: false),
- ManualRemarks = table.Column<string>(type: "nvarchar(max)", 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_TASK", x => x.ID);
- });
- migrationBuilder.CreateTable(
- name: "WCS_Users",
- columns: table => new
- {
- USER_NO = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
- USER_PWD = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
- USER_TEXT = table.Column<byte[]>(type: "varbinary(max)", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_WCS_Users", x => x.USER_NO);
- });
- 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(130)", maxLength: 130, 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_BCR80", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_BCR80_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE");
- });
- migrationBuilder.CreateTable(
- name: "WCS_PATH",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- STARTCODE = table.Column<string>(type: "nvarchar(50)", nullable: false),
- ENDCODE = table.Column<string>(type: "nvarchar(50)", nullable: false),
- PATH = table.Column<string>(type: "nvarchar(max)", 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_PATH", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_PATH_WCS_DEVICE_ENDCODE",
- column: x => x.ENDCODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- table.ForeignKey(
- name: "FK_WCS_PATH_WCS_DEVICE_STARTCODE",
- column: x => x.STARTCODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateTable(
- name: "WCS_PATHPOINT",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- STARTCODE = table.Column<string>(type: "nvarchar(50)", nullable: false),
- ENDCODE = table.Column<string>(type: "nvarchar(50)", nullable: false),
- DEVICECODE = table.Column<string>(type: "nvarchar(50)", nullable: false),
- PREVCODE = table.Column<string>(type: "nvarchar(50)", nullable: true),
- NEXTCODE = table.Column<string>(type: "nvarchar(50)", 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_PATHPOINT", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_PATHPOINT_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- table.ForeignKey(
- name: "FK_WCS_PATHPOINT_WCS_DEVICE_ENDCODE",
- column: x => x.ENDCODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- table.ForeignKey(
- name: "FK_WCS_PATHPOINT_WCS_DEVICE_NEXTCODE",
- column: x => x.NEXTCODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE");
- table.ForeignKey(
- name: "FK_WCS_PATHPOINT_WCS_DEVICE_PREVCODE",
- column: x => x.PREVCODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE");
- table.ForeignKey(
- name: "FK_WCS_PATHPOINT_WCS_DEVICE_STARTCODE",
- column: x => x.STARTCODE,
- 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<int>(type: "int", 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<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_RGV520", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_RGV520_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE");
- });
- 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),
- RES1_1 = 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),
- RES3_1 = table.Column<bool>(type: "bit", nullable: false),
- RES4_1 = table.Column<bool>(type: "bit", nullable: false),
- RES5_1 = table.Column<bool>(type: "bit", nullable: false),
- RES6_1 = table.Column<bool>(type: "bit", nullable: false),
- RES7_1 = table.Column<bool>(type: "bit", nullable: false),
- Trigger_1 = table.Column<int>(type: "int", 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),
- RES3_2 = table.Column<bool>(type: "bit", nullable: false),
- RES4_2 = table.Column<bool>(type: "bit", nullable: false),
- RES5_2 = table.Column<bool>(type: "bit", nullable: false),
- RES6_2 = table.Column<bool>(type: "bit", nullable: false),
- RES7_2 = table.Column<bool>(type: "bit", nullable: false),
- Trigger_2 = table.Column<int>(type: "int", nullable: false),
- SystemStatus = table.Column<short>(type: "smallint", nullable: false),
- WorkMode = 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");
- });
- 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");
- });
- migrationBuilder.CreateTable(
- name: "WCS_ROUTE",
- 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),
- NEXTCODE = table.Column<string>(type: "nvarchar(50)", 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_ROUTE", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_ROUTE_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- table.ForeignKey(
- name: "FK_WCS_ROUTE_WCS_DEVICE_NEXTCODE",
- column: x => x.NEXTCODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateTable(
- name: "WCS_STATION50",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- S_TaskId = table.Column<int>(type: "int", nullable: false),
- S_GoodsCode = table.Column<int>(type: "int", nullable: false),
- S_GoodsType = table.Column<short>(type: "smallint", nullable: false),
- S_GoodsSize = table.Column<short>(type: "smallint", nullable: false),
- S_GoodsStart = table.Column<short>(type: "smallint", nullable: false),
- S_GoodsEnd = table.Column<short>(type: "smallint", nullable: false),
- S_Height = table.Column<short>(type: "smallint", nullable: false),
- G_TaskId = table.Column<int>(type: "int", nullable: false),
- G_GoodsStart = table.Column<short>(type: "smallint", nullable: false),
- G_GoodsEnd = table.Column<short>(type: "smallint", nullable: false),
- G_GoodsCode = table.Column<int>(type: "int", nullable: false),
- G_GoodsType = table.Column<short>(type: "smallint", nullable: false),
- G_GoodsSize = table.Column<short>(type: "smallint", nullable: false),
- G_Height = table.Column<short>(type: "smallint", nullable: false),
- S_Confirm = table.Column<bool>(type: "bit", nullable: false),
- G_Station_Ready = table.Column<bool>(type: "bit", nullable: false),
- S_TaskDelete = table.Column<bool>(type: "bit", nullable: false),
- G_Notask = table.Column<bool>(type: "bit", nullable: false),
- G_PhStatus = table.Column<bool>(type: "bit", nullable: false),
- G_Request = table.Column<bool>(type: "bit", nullable: false),
- G_GoodsError = table.Column<bool>(type: "bit", nullable: false),
- G_F_Outside = table.Column<bool>(type: "bit", nullable: false),
- G_B_Outside = table.Column<bool>(type: "bit", nullable: false),
- G_L_Outside = table.Column<bool>(type: "bit", nullable: false),
- G_R_Outside = table.Column<bool>(type: "bit", nullable: false),
- G_H_Outside = table.Column<bool>(type: "bit", nullable: false),
- G_BCR_NoRead = table.Column<bool>(type: "bit", nullable: false),
- G_Overload = table.Column<bool>(type: "bit", nullable: false),
- S_AGV_Put_OK = table.Column<bool>(type: "bit", nullable: false),
- S_AGV_Get_OK = table.Column<bool>(type: "bit", nullable: false),
- G_Weight = 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_STATION50", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_STATION50_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE");
- });
- migrationBuilder.CreateTable(
- name: "WCS_STATION70",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Alarm = table.Column<int>(type: "int", nullable: false),
- RES = table.Column<short>(type: "smallint", nullable: false),
- Status = table.Column<int>(type: "int", 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_STATION70", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_STATION70_WCS_DEVICE_DEVICECODE",
- column: x => x.DEVICECODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE");
- });
- 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");
- });
- 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: false),
- 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.Restrict);
- });
- 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_PATH_ENDCODE",
- table: "WCS_PATH",
- column: "ENDCODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_PATH_STARTCODE",
- table: "WCS_PATH",
- column: "STARTCODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_PATHPOINT_DEVICECODE",
- table: "WCS_PATHPOINT",
- column: "DEVICECODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_PATHPOINT_ENDCODE",
- table: "WCS_PATHPOINT",
- column: "ENDCODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_PATHPOINT_NEXTCODE",
- table: "WCS_PATHPOINT",
- column: "NEXTCODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_PATHPOINT_PREVCODE",
- table: "WCS_PATHPOINT",
- column: "PREVCODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_PATHPOINT_STARTCODE",
- table: "WCS_PATHPOINT",
- column: "STARTCODE");
- 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_ROUTE_DEVICECODE",
- table: "WCS_ROUTE",
- column: "DEVICECODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_ROUTE_NEXTCODE",
- table: "WCS_ROUTE",
- column: "NEXTCODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_STATION50_DEVICECODE",
- table: "WCS_STATION50",
- column: "DEVICECODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_STATION70_DEVICECODE",
- table: "WCS_STATION70",
- column: "DEVICECODE");
- }
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "WCS_AGVTask");
- migrationBuilder.DropTable(
- name: "WCS_BCR80");
- migrationBuilder.DropTable(
- name: "WCS_CMD");
- migrationBuilder.DropTable(
- name: "WCS_DEVICEPROTOCOL");
- migrationBuilder.DropTable(
- name: "WCS_EXCEPTION");
- migrationBuilder.DropTable(
- name: "WCS_MAPPINGENTRY");
- migrationBuilder.DropTable(
- name: "WCS_PATH");
- migrationBuilder.DropTable(
- name: "WCS_PATHPOINT");
- migrationBuilder.DropTable(
- name: "WCS_RGV520");
- migrationBuilder.DropTable(
- name: "WCS_RGV521");
- migrationBuilder.DropTable(
- name: "WCS_RGV523");
- migrationBuilder.DropTable(
- name: "WCS_ROUTE");
- migrationBuilder.DropTable(
- name: "WCS_STATION50");
- migrationBuilder.DropTable(
- name: "WCS_STATION70");
- migrationBuilder.DropTable(
- name: "WCS_StatusLog");
- migrationBuilder.DropTable(
- name: "WCS_SystemConfig");
- migrationBuilder.DropTable(
- name: "WCS_TASK");
- migrationBuilder.DropTable(
- name: "WCS_Users");
- migrationBuilder.DropTable(
- name: "WCS_DATABLOCK");
- migrationBuilder.DropTable(
- name: "WCS_DEVICE");
- migrationBuilder.DropTable(
- name: "WCS_PLC");
- }
- }
- }
|