123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- namespace WCS.Service.Migrations
- {
- public partial class _21041407 : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_WCS_BCRDATA_WCS_DEVICEITEM_PROTOCOLID",
- table: "WCS_BCRDATA");
- migrationBuilder.DropIndex(
- name: "IX_WCS_BCRDATA_PROTOCOLID",
- table: "WCS_BCRDATA");
- migrationBuilder.DropColumn(
- name: "PROTOCOLID",
- table: "WCS_BCRDATA");
- migrationBuilder.AddColumn<string>(
- name: "DEVICECODE",
- table: "WCS_STATIONSTATUSDATA",
- type: "nvarchar(50)",
- nullable: true);
- migrationBuilder.AddColumn<DateTime>(
- name: "FRAME",
- table: "WCS_STATIONSTATUSDATA",
- type: "datetime2",
- nullable: false,
- defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
- migrationBuilder.AddColumn<bool>(
- name: "ISLAST",
- table: "WCS_STATIONSTATUSDATA",
- type: "bit",
- nullable: false,
- defaultValue: false);
- migrationBuilder.AddColumn<string>(
- name: "DEVICECODE",
- table: "WCS_STATIONDATA",
- type: "nvarchar(50)",
- nullable: true);
- migrationBuilder.AddColumn<DateTime>(
- name: "FRAME",
- table: "WCS_STATIONDATA",
- type: "datetime2",
- nullable: false,
- defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
- migrationBuilder.AddColumn<bool>(
- name: "ISLAST",
- table: "WCS_STATIONDATA",
- type: "bit",
- nullable: false,
- defaultValue: false);
- migrationBuilder.AddColumn<string>(
- name: "DEVICECODE",
- table: "WCS_BCRDATA",
- type: "nvarchar(50)",
- nullable: true);
- migrationBuilder.CreateIndex(
- name: "IX_WCS_STATIONSTATUSDATA_DEVICECODE",
- table: "WCS_STATIONSTATUSDATA",
- column: "DEVICECODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_STATIONDATA_DEVICECODE",
- table: "WCS_STATIONDATA",
- column: "DEVICECODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_BCRDATA_DEVICECODE",
- table: "WCS_BCRDATA",
- column: "DEVICECODE");
- migrationBuilder.AddForeignKey(
- name: "FK_WCS_BCRDATA_WCS_DEVICE_DEVICECODE",
- table: "WCS_BCRDATA",
- column: "DEVICECODE",
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- migrationBuilder.AddForeignKey(
- name: "FK_WCS_STATIONDATA_WCS_DEVICE_DEVICECODE",
- table: "WCS_STATIONDATA",
- column: "DEVICECODE",
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- migrationBuilder.AddForeignKey(
- name: "FK_WCS_STATIONSTATUSDATA_WCS_DEVICE_DEVICECODE",
- table: "WCS_STATIONSTATUSDATA",
- column: "DEVICECODE",
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- }
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_WCS_BCRDATA_WCS_DEVICE_DEVICECODE",
- table: "WCS_BCRDATA");
- migrationBuilder.DropForeignKey(
- name: "FK_WCS_STATIONDATA_WCS_DEVICE_DEVICECODE",
- table: "WCS_STATIONDATA");
- migrationBuilder.DropForeignKey(
- name: "FK_WCS_STATIONSTATUSDATA_WCS_DEVICE_DEVICECODE",
- table: "WCS_STATIONSTATUSDATA");
- migrationBuilder.DropIndex(
- name: "IX_WCS_STATIONSTATUSDATA_DEVICECODE",
- table: "WCS_STATIONSTATUSDATA");
- migrationBuilder.DropIndex(
- name: "IX_WCS_STATIONDATA_DEVICECODE",
- table: "WCS_STATIONDATA");
- migrationBuilder.DropIndex(
- name: "IX_WCS_BCRDATA_DEVICECODE",
- table: "WCS_BCRDATA");
- migrationBuilder.DropColumn(
- name: "DEVICECODE",
- table: "WCS_STATIONSTATUSDATA");
- migrationBuilder.DropColumn(
- name: "FRAME",
- table: "WCS_STATIONSTATUSDATA");
- migrationBuilder.DropColumn(
- name: "ISLAST",
- table: "WCS_STATIONSTATUSDATA");
- migrationBuilder.DropColumn(
- name: "DEVICECODE",
- table: "WCS_STATIONDATA");
- migrationBuilder.DropColumn(
- name: "FRAME",
- table: "WCS_STATIONDATA");
- migrationBuilder.DropColumn(
- name: "ISLAST",
- table: "WCS_STATIONDATA");
- migrationBuilder.DropColumn(
- name: "DEVICECODE",
- table: "WCS_BCRDATA");
- migrationBuilder.AddColumn<int>(
- name: "PROTOCOLID",
- table: "WCS_BCRDATA",
- type: "int",
- nullable: true);
- migrationBuilder.CreateIndex(
- name: "IX_WCS_BCRDATA_PROTOCOLID",
- table: "WCS_BCRDATA",
- column: "PROTOCOLID");
- migrationBuilder.AddForeignKey(
- name: "FK_WCS_BCRDATA_WCS_DEVICEITEM_PROTOCOLID",
- table: "WCS_BCRDATA",
- column: "PROTOCOLID",
- principalTable: "WCS_DEVICEITEM",
- principalColumn: "ID",
- onDelete: ReferentialAction.Restrict);
- }
- }
- }
|