mh_jy_safe/APT.Data.Migrations/Migrations/20251111094647_hmr2025111101.cs
2025-11-11 17:48:25 +08:00

303 lines
14 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace APT.Data.Migrations.Migrations
{
public partial class hmr2025111101 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_T_FO_LEADER_WELL_RECORD_DETAIL_T_FM_USER_AFTER_USER_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL");
migrationBuilder.DropForeignKey(
name: "FK_T_FO_LEADER_WELL_RECORD_DETAIL_T_FM_USER_PRE_USER_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL");
migrationBuilder.DropIndex(
name: "IX_T_FO_LEADER_WELL_RECORD_DETAIL_AFTER_USER_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL");
migrationBuilder.DropIndex(
name: "IX_T_FO_LEADER_WELL_RECORD_DETAIL_PRE_USER_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL");
migrationBuilder.DropColumn(
name: "AFTER_USER_DEAL_STATUS",
table: "T_FO_LEADER_WELL_RECORD_DETAIL");
migrationBuilder.DropColumn(
name: "AFTER_USER_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL");
migrationBuilder.DropColumn(
name: "PRE_USER_DEAL_STATUS",
table: "T_FO_LEADER_WELL_RECORD_DETAIL");
migrationBuilder.DropColumn(
name: "PRE_USER_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL");
migrationBuilder.AddColumn<Guid>(
name: "AREA_ID",
table: "T_SK_CHECK_SET_CONTENTS",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "ENTERPRISE_LIBRARY_DETAIL_ID",
table: "T_SK_CHECK_SET_CONTENTS",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "ENTERPRISE_LIBRARY_ID",
table: "T_SK_CHECK_SET_CONTENTS",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "MEASURES_NAME",
table: "T_SK_CHECK_SET_CONTENTS",
type: "nvarchar(300)",
maxLength: 300,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "RISK_NAME",
table: "T_SK_CHECK_SET_CONTENTS",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "POST_NAME",
table: "T_SK_CHECK_SET",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
migrationBuilder.CreateTable(
name: "T_FO_LEADER_WELL_RECORD_DETAIL_AFTERUSER",
columns: table => new
{
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
LEADER_WELL_RECORD_DETAIL_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
AFTER_USER_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
AFTER_USER_DEAL_STATUS = table.Column<int>(type: "int", nullable: true),
IS_DELETED = table.Column<bool>(type: "bit", nullable: false),
ORG_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ENTITY_ORG_TPYE = table.Column<int>(type: "int", nullable: false),
FORM_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
FLOW_STATUS = table.Column<int>(type: "int", nullable: false),
FLOW_SEND_STATUS = table.Column<int>(type: "int", nullable: false),
FLOW_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CREATE_TIME = table.Column<DateTime>(type: "datetime2", nullable: true),
MODIFY_TIME = table.Column<DateTime>(type: "datetime2", nullable: true),
CREATER_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
MODIFIER_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_T_FO_LEADER_WELL_RECORD_DETAIL_AFTERUSER", x => x.ID);
table.ForeignKey(
name: "FK_T_FO_LEADER_WELL_RECORD_DETAIL_AFTERUSER_T_FM_ORGANIZATION_ORG_ID",
column: x => x.ORG_ID,
principalTable: "T_FM_ORGANIZATION",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_T_FO_LEADER_WELL_RECORD_DETAIL_AFTERUSER_T_FM_USER_AFTER_USER_ID",
column: x => x.AFTER_USER_ID,
principalTable: "T_FM_USER",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_T_FO_LEADER_WELL_RECORD_DETAIL_AFTERUSER_T_FO_LEADER_WELL_RECORD_DETAIL_LEADER_WELL_RECORD_DETAIL_ID",
column: x => x.LEADER_WELL_RECORD_DETAIL_ID,
principalTable: "T_FO_LEADER_WELL_RECORD_DETAIL",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "T_FO_LEADER_WELL_RECORD_DETAIL_PREUSER",
columns: table => new
{
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
LEADER_WELL_RECORD_DETAIL_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
PRE_USER_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
PRE_USER_DEAL_STATUS = table.Column<int>(type: "int", nullable: true),
IS_DELETED = table.Column<bool>(type: "bit", nullable: false),
ORG_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ENTITY_ORG_TPYE = table.Column<int>(type: "int", nullable: false),
FORM_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
FLOW_STATUS = table.Column<int>(type: "int", nullable: false),
FLOW_SEND_STATUS = table.Column<int>(type: "int", nullable: false),
FLOW_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CREATE_TIME = table.Column<DateTime>(type: "datetime2", nullable: true),
MODIFY_TIME = table.Column<DateTime>(type: "datetime2", nullable: true),
CREATER_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
MODIFIER_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_T_FO_LEADER_WELL_RECORD_DETAIL_PREUSER", x => x.ID);
table.ForeignKey(
name: "FK_T_FO_LEADER_WELL_RECORD_DETAIL_PREUSER_T_FM_ORGANIZATION_ORG_ID",
column: x => x.ORG_ID,
principalTable: "T_FM_ORGANIZATION",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_T_FO_LEADER_WELL_RECORD_DETAIL_PREUSER_T_FM_USER_PRE_USER_ID",
column: x => x.PRE_USER_ID,
principalTable: "T_FM_USER",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_T_FO_LEADER_WELL_RECORD_DETAIL_PREUSER_T_FO_LEADER_WELL_RECORD_DETAIL_LEADER_WELL_RECORD_DETAIL_ID",
column: x => x.LEADER_WELL_RECORD_DETAIL_ID,
principalTable: "T_FO_LEADER_WELL_RECORD_DETAIL",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_T_SK_CHECK_SET_CONTENTS_AREA_ID",
table: "T_SK_CHECK_SET_CONTENTS",
column: "AREA_ID");
migrationBuilder.CreateIndex(
name: "IX_T_FO_LEADER_WELL_RECORD_DETAIL_AFTERUSER_AFTER_USER_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL_AFTERUSER",
column: "AFTER_USER_ID");
migrationBuilder.CreateIndex(
name: "IX_T_FO_LEADER_WELL_RECORD_DETAIL_AFTERUSER_LEADER_WELL_RECORD_DETAIL_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL_AFTERUSER",
column: "LEADER_WELL_RECORD_DETAIL_ID");
migrationBuilder.CreateIndex(
name: "IX_T_FO_LEADER_WELL_RECORD_DETAIL_AFTERUSER_ORG_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL_AFTERUSER",
column: "ORG_ID");
migrationBuilder.CreateIndex(
name: "IX_T_FO_LEADER_WELL_RECORD_DETAIL_PREUSER_LEADER_WELL_RECORD_DETAIL_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL_PREUSER",
column: "LEADER_WELL_RECORD_DETAIL_ID");
migrationBuilder.CreateIndex(
name: "IX_T_FO_LEADER_WELL_RECORD_DETAIL_PREUSER_ORG_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL_PREUSER",
column: "ORG_ID");
migrationBuilder.CreateIndex(
name: "IX_T_FO_LEADER_WELL_RECORD_DETAIL_PREUSER_PRE_USER_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL_PREUSER",
column: "PRE_USER_ID");
migrationBuilder.AddForeignKey(
name: "FK_T_SK_CHECK_SET_CONTENTS_T_SK_RISK_AREA_AREA_ID",
table: "T_SK_CHECK_SET_CONTENTS",
column: "AREA_ID",
principalTable: "T_SK_RISK_AREA",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_T_SK_CHECK_SET_CONTENTS_T_SK_RISK_AREA_AREA_ID",
table: "T_SK_CHECK_SET_CONTENTS");
migrationBuilder.DropTable(
name: "T_FO_LEADER_WELL_RECORD_DETAIL_AFTERUSER");
migrationBuilder.DropTable(
name: "T_FO_LEADER_WELL_RECORD_DETAIL_PREUSER");
migrationBuilder.DropIndex(
name: "IX_T_SK_CHECK_SET_CONTENTS_AREA_ID",
table: "T_SK_CHECK_SET_CONTENTS");
migrationBuilder.DropColumn(
name: "AREA_ID",
table: "T_SK_CHECK_SET_CONTENTS");
migrationBuilder.DropColumn(
name: "ENTERPRISE_LIBRARY_DETAIL_ID",
table: "T_SK_CHECK_SET_CONTENTS");
migrationBuilder.DropColumn(
name: "ENTERPRISE_LIBRARY_ID",
table: "T_SK_CHECK_SET_CONTENTS");
migrationBuilder.DropColumn(
name: "MEASURES_NAME",
table: "T_SK_CHECK_SET_CONTENTS");
migrationBuilder.DropColumn(
name: "RISK_NAME",
table: "T_SK_CHECK_SET_CONTENTS");
migrationBuilder.DropColumn(
name: "POST_NAME",
table: "T_SK_CHECK_SET");
migrationBuilder.AddColumn<int>(
name: "AFTER_USER_DEAL_STATUS",
table: "T_FO_LEADER_WELL_RECORD_DETAIL",
type: "int",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "AFTER_USER_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "PRE_USER_DEAL_STATUS",
table: "T_FO_LEADER_WELL_RECORD_DETAIL",
type: "int",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "PRE_USER_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_T_FO_LEADER_WELL_RECORD_DETAIL_AFTER_USER_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL",
column: "AFTER_USER_ID");
migrationBuilder.CreateIndex(
name: "IX_T_FO_LEADER_WELL_RECORD_DETAIL_PRE_USER_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL",
column: "PRE_USER_ID");
migrationBuilder.AddForeignKey(
name: "FK_T_FO_LEADER_WELL_RECORD_DETAIL_T_FM_USER_AFTER_USER_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL",
column: "AFTER_USER_ID",
principalTable: "T_FM_USER",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_T_FO_LEADER_WELL_RECORD_DETAIL_T_FM_USER_PRE_USER_ID",
table: "T_FO_LEADER_WELL_RECORD_DETAIL",
column: "PRE_USER_ID",
principalTable: "T_FM_USER",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
}
}
}