20210414040946_21041406.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. namespace WCS.Service.Migrations
  4. {
  5. public partial class _21041406 : Migration
  6. {
  7. protected override void Up(MigrationBuilder migrationBuilder)
  8. {
  9. migrationBuilder.AddColumn<DateTime>(
  10. name: "FRAME",
  11. table: "WCS_BCRDATA",
  12. type: "datetime2",
  13. nullable: false,
  14. defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
  15. migrationBuilder.AddColumn<bool>(
  16. name: "ISLAST",
  17. table: "WCS_BCRDATA",
  18. type: "bit",
  19. nullable: false,
  20. defaultValue: false);
  21. migrationBuilder.AddColumn<int>(
  22. name: "PROTOCOLID",
  23. table: "WCS_BCRDATA",
  24. type: "int",
  25. nullable: true);
  26. migrationBuilder.CreateIndex(
  27. name: "IX_WCS_BCRDATA_PROTOCOLID",
  28. table: "WCS_BCRDATA",
  29. column: "PROTOCOLID");
  30. migrationBuilder.AddForeignKey(
  31. name: "FK_WCS_BCRDATA_WCS_DEVICEITEM_PROTOCOLID",
  32. table: "WCS_BCRDATA",
  33. column: "PROTOCOLID",
  34. principalTable: "WCS_DEVICEITEM",
  35. principalColumn: "ID",
  36. onDelete: ReferentialAction.Restrict);
  37. }
  38. protected override void Down(MigrationBuilder migrationBuilder)
  39. {
  40. migrationBuilder.DropForeignKey(
  41. name: "FK_WCS_BCRDATA_WCS_DEVICEITEM_PROTOCOLID",
  42. table: "WCS_BCRDATA");
  43. migrationBuilder.DropIndex(
  44. name: "IX_WCS_BCRDATA_PROTOCOLID",
  45. table: "WCS_BCRDATA");
  46. migrationBuilder.DropColumn(
  47. name: "FRAME",
  48. table: "WCS_BCRDATA");
  49. migrationBuilder.DropColumn(
  50. name: "ISLAST",
  51. table: "WCS_BCRDATA");
  52. migrationBuilder.DropColumn(
  53. name: "PROTOCOLID",
  54. table: "WCS_BCRDATA");
  55. }
  56. }
  57. }