46 lines
1.5 KiB
C#
46 lines
1.5 KiB
C#
|
|
using System;
|
|||
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|
|||
|
|
namespace APT.Data.Migrations.Migrations
|
|||
|
|
{
|
|||
|
|
public partial class wyw2025082001 : Migration
|
|||
|
|
{
|
|||
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
|
{
|
|||
|
|
migrationBuilder.AddColumn<Guid>(
|
|||
|
|
name: "DEPARTMENT_ID",
|
|||
|
|
table: "T_WB_REGISTER",
|
|||
|
|
type: "uniqueidentifier",
|
|||
|
|
nullable: true);
|
|||
|
|
|
|||
|
|
migrationBuilder.CreateIndex(
|
|||
|
|
name: "IX_T_WB_REGISTER_DEPARTMENT_ID",
|
|||
|
|
table: "T_WB_REGISTER",
|
|||
|
|
column: "DEPARTMENT_ID");
|
|||
|
|
|
|||
|
|
migrationBuilder.AddForeignKey(
|
|||
|
|
name: "FK_T_WB_REGISTER_T_FM_DEPARTMENT_DEPARTMENT_ID",
|
|||
|
|
table: "T_WB_REGISTER",
|
|||
|
|
column: "DEPARTMENT_ID",
|
|||
|
|
principalTable: "T_FM_DEPARTMENT",
|
|||
|
|
principalColumn: "ID",
|
|||
|
|
onDelete: ReferentialAction.Restrict);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
|
{
|
|||
|
|
migrationBuilder.DropForeignKey(
|
|||
|
|
name: "FK_T_WB_REGISTER_T_FM_DEPARTMENT_DEPARTMENT_ID",
|
|||
|
|
table: "T_WB_REGISTER");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropIndex(
|
|||
|
|
name: "IX_T_WB_REGISTER_DEPARTMENT_ID",
|
|||
|
|
table: "T_WB_REGISTER");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropColumn(
|
|||
|
|
name: "DEPARTMENT_ID",
|
|||
|
|
table: "T_WB_REGISTER");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|