mh_jy_safe/APT.Data.Migrations/Migrations/20250731023729_wyw2025073101.cs

170 lines
6.3 KiB
C#
Raw Normal View History

2025-08-25 09:56:57 +08:00
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace APT.Data.Migrations.Migrations
{
public partial class wyw2025073101 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK_TASK",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK_RECORD",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "DEPARTMENT_ID",
table: "T_WB_HIDDEN_DANGER_RECORD",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "DEPARTMENT_ID",
table: "T_WB_HIDDEN_DANGER_NOTIFY",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_T_WB_SAFE_CHECK_TASK_DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK_TASK",
column: "DEPARTMENT_ID");
migrationBuilder.CreateIndex(
name: "IX_T_WB_SAFE_CHECK_RECORD_DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK_RECORD",
column: "DEPARTMENT_ID");
migrationBuilder.CreateIndex(
name: "IX_T_WB_SAFE_CHECK_DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK",
column: "DEPARTMENT_ID");
migrationBuilder.CreateIndex(
name: "IX_T_WB_HIDDEN_DANGER_RECORD_DEPARTMENT_ID",
table: "T_WB_HIDDEN_DANGER_RECORD",
column: "DEPARTMENT_ID");
migrationBuilder.CreateIndex(
name: "IX_T_WB_HIDDEN_DANGER_NOTIFY_DEPARTMENT_ID",
table: "T_WB_HIDDEN_DANGER_NOTIFY",
column: "DEPARTMENT_ID");
migrationBuilder.AddForeignKey(
name: "FK_T_WB_HIDDEN_DANGER_NOTIFY_T_FM_DEPARTMENT_DEPARTMENT_ID",
table: "T_WB_HIDDEN_DANGER_NOTIFY",
column: "DEPARTMENT_ID",
principalTable: "T_FM_DEPARTMENT",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_T_WB_HIDDEN_DANGER_RECORD_T_FM_DEPARTMENT_DEPARTMENT_ID",
table: "T_WB_HIDDEN_DANGER_RECORD",
column: "DEPARTMENT_ID",
principalTable: "T_FM_DEPARTMENT",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_T_WB_SAFE_CHECK_T_FM_DEPARTMENT_DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK",
column: "DEPARTMENT_ID",
principalTable: "T_FM_DEPARTMENT",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_T_WB_SAFE_CHECK_RECORD_T_FM_DEPARTMENT_DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK_RECORD",
column: "DEPARTMENT_ID",
principalTable: "T_FM_DEPARTMENT",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_T_WB_SAFE_CHECK_TASK_T_FM_DEPARTMENT_DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK_TASK",
column: "DEPARTMENT_ID",
principalTable: "T_FM_DEPARTMENT",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_T_WB_HIDDEN_DANGER_NOTIFY_T_FM_DEPARTMENT_DEPARTMENT_ID",
table: "T_WB_HIDDEN_DANGER_NOTIFY");
migrationBuilder.DropForeignKey(
name: "FK_T_WB_HIDDEN_DANGER_RECORD_T_FM_DEPARTMENT_DEPARTMENT_ID",
table: "T_WB_HIDDEN_DANGER_RECORD");
migrationBuilder.DropForeignKey(
name: "FK_T_WB_SAFE_CHECK_T_FM_DEPARTMENT_DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK");
migrationBuilder.DropForeignKey(
name: "FK_T_WB_SAFE_CHECK_RECORD_T_FM_DEPARTMENT_DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK_RECORD");
migrationBuilder.DropForeignKey(
name: "FK_T_WB_SAFE_CHECK_TASK_T_FM_DEPARTMENT_DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK_TASK");
migrationBuilder.DropIndex(
name: "IX_T_WB_SAFE_CHECK_TASK_DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK_TASK");
migrationBuilder.DropIndex(
name: "IX_T_WB_SAFE_CHECK_RECORD_DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK_RECORD");
migrationBuilder.DropIndex(
name: "IX_T_WB_SAFE_CHECK_DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK");
migrationBuilder.DropIndex(
name: "IX_T_WB_HIDDEN_DANGER_RECORD_DEPARTMENT_ID",
table: "T_WB_HIDDEN_DANGER_RECORD");
migrationBuilder.DropIndex(
name: "IX_T_WB_HIDDEN_DANGER_NOTIFY_DEPARTMENT_ID",
table: "T_WB_HIDDEN_DANGER_NOTIFY");
migrationBuilder.DropColumn(
name: "DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK_TASK");
migrationBuilder.DropColumn(
name: "DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK_RECORD");
migrationBuilder.DropColumn(
name: "DEPARTMENT_ID",
table: "T_WB_SAFE_CHECK");
migrationBuilder.DropColumn(
name: "DEPARTMENT_ID",
table: "T_WB_HIDDEN_DANGER_RECORD");
migrationBuilder.DropColumn(
name: "DEPARTMENT_ID",
table: "T_WB_HIDDEN_DANGER_NOTIFY");
}
}
}