1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace WCS.Service.Migrations
- {
- public partial class _4 : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "WCS_DEVICEGROUP",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- GROUPCODE = table.Column<string>(type: "nvarchar(50)", nullable: false),
- MEMBERCODE = 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_DEVICEGROUP", x => x.ID);
- table.ForeignKey(
- name: "FK_WCS_DEVICEGROUP_WCS_DEVICE_GROUPCODE",
- column: x => x.GROUPCODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- table.ForeignKey(
- name: "FK_WCS_DEVICEGROUP_WCS_DEVICE_MEMBERCODE",
- column: x => x.MEMBERCODE,
- principalTable: "WCS_DEVICE",
- principalColumn: "CODE",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateIndex(
- name: "IX_WCS_DEVICEGROUP_GROUPCODE",
- table: "WCS_DEVICEGROUP",
- column: "GROUPCODE");
- migrationBuilder.CreateIndex(
- name: "IX_WCS_DEVICEGROUP_MEMBERCODE",
- table: "WCS_DEVICEGROUP",
- column: "MEMBERCODE");
- }
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "WCS_DEVICEGROUP");
- }
- }
- }
|