mh_jy_safe/APT.Data.Migrations/Migrations/20250726033018_hmr2025072601.cs
2025-08-25 09:56:57 +08:00

294 lines
11 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace APT.Data.Migrations.Migrations
{
public partial class hmr2025072601 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "HIDDEN_LEVEL",
table: "T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<int>(
name: "CHECK_RESULT",
table: "T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<int>(
name: "HIDDEN_LEVEL",
table: "T_SK_SECURITY_INSPECTION_RECORD_DETAIL",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<int>(
name: "CHECK_RESULT",
table: "T_SK_SECURITY_INSPECTION_RECORD_DETAIL",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<int>(
name: "HIDDEN_LEVEL",
table: "T_SK_HIDDEN_DANGER_REPORT_DETAIL",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<int>(
name: "HIDDEN_LEVEL",
table: "T_SK_HIDDEN_DANGER_RECTIFY_RECORD",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<int>(
name: "HIDDEN_LEVEL",
table: "T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<int>(
name: "HIDDEN_LEVEL",
table: "T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_HIDDEN",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<int>(
name: "HIDDEN_LEVEL",
table: "T_SK_DOUBLE_PREVENT_MECHANISM_DETAIL_MEASURES_CONTENT_HIDDEN",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<int>(
name: "QUESTION_LEVEL",
table: "T_SK_CHECK_QUESTION",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AddColumn<string>(
name: "CHECK_STANDARD",
table: "T_SK_CHECK_CONTENTS",
type: "nvarchar(500)",
maxLength: 500,
nullable: true);
migrationBuilder.AddColumn<int>(
name: "MineType",
table: "T_SK_CHECK_CONTENTS",
type: "int",
nullable: true);
migrationBuilder.AlterColumn<int>(
name: "HIDDEN_LEVEL",
table: "T_SK_BASIC_LIBRARY_DETAIL_CONTENT_HIDDEN",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.CreateTable(
name: "T_SK_CHECK_CONTENTS_BASIC",
columns: table => new
{
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
CHECK_CONTENTS_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LAW_ID = table.Column<Guid>(type: "uniqueidentifier", 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_SK_CHECK_CONTENTS_BASIC", x => x.ID);
table.ForeignKey(
name: "FK_T_SK_CHECK_CONTENTS_BASIC_T_FM_ORGANIZATION_ORG_ID",
column: x => x.ORG_ID,
principalTable: "T_FM_ORGANIZATION",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_T_SK_CHECK_CONTENTS_BASIC_T_LR_LAW_LAW_ID",
column: x => x.LAW_ID,
principalTable: "T_LR_LAW",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_T_SK_CHECK_CONTENTS_BASIC_T_SK_CHECK_CONTENTS_CHECK_CONTENTS_ID",
column: x => x.CHECK_CONTENTS_ID,
principalTable: "T_SK_CHECK_CONTENTS",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_T_SK_CHECK_CONTENTS_BASIC_CHECK_CONTENTS_ID",
table: "T_SK_CHECK_CONTENTS_BASIC",
column: "CHECK_CONTENTS_ID");
migrationBuilder.CreateIndex(
name: "IX_T_SK_CHECK_CONTENTS_BASIC_LAW_ID",
table: "T_SK_CHECK_CONTENTS_BASIC",
column: "LAW_ID");
migrationBuilder.CreateIndex(
name: "IX_T_SK_CHECK_CONTENTS_BASIC_ORG_ID",
table: "T_SK_CHECK_CONTENTS_BASIC",
column: "ORG_ID");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "T_SK_CHECK_CONTENTS_BASIC");
migrationBuilder.DropColumn(
name: "CHECK_STANDARD",
table: "T_SK_CHECK_CONTENTS");
migrationBuilder.DropColumn(
name: "MineType",
table: "T_SK_CHECK_CONTENTS");
migrationBuilder.AlterColumn<int>(
name: "HIDDEN_LEVEL",
table: "T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "CHECK_RESULT",
table: "T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "HIDDEN_LEVEL",
table: "T_SK_SECURITY_INSPECTION_RECORD_DETAIL",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "CHECK_RESULT",
table: "T_SK_SECURITY_INSPECTION_RECORD_DETAIL",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "HIDDEN_LEVEL",
table: "T_SK_HIDDEN_DANGER_REPORT_DETAIL",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "HIDDEN_LEVEL",
table: "T_SK_HIDDEN_DANGER_RECTIFY_RECORD",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "HIDDEN_LEVEL",
table: "T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "HIDDEN_LEVEL",
table: "T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_HIDDEN",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "HIDDEN_LEVEL",
table: "T_SK_DOUBLE_PREVENT_MECHANISM_DETAIL_MEASURES_CONTENT_HIDDEN",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "QUESTION_LEVEL",
table: "T_SK_CHECK_QUESTION",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "HIDDEN_LEVEL",
table: "T_SK_BASIC_LIBRARY_DETAIL_CONTENT_HIDDEN",
type: "int",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
}
}
}