413 lines
		
	
	
		
			24 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
		
		
			
		
	
	
			413 lines
		
	
	
		
			24 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| 
								 | 
							
								using System;
							 | 
						|||
| 
								 | 
							
								using Microsoft.EntityFrameworkCore.Migrations;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace APT.Data.Migrations.Migrations
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    public partial class hmr2025102401 : Migration
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        protected override void Up(MigrationBuilder migrationBuilder)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_SK_HIDDEN_REASON",
							 | 
						|||
| 
								 | 
							
								                columns: table => new
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    CODE = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
							 | 
						|||
| 
								 | 
							
								                    NAME = table.Column<string>(type: "nvarchar(100)", maxLength: 100, 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_HIDDEN_REASON", x => x.ID);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_SK_HIDDEN_REASON_T_FM_ORGANIZATION_ORG_ID",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.ORG_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_FM_ORGANIZATION",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                });
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_SK_HIDDEN_DANGER_CONFIRM_REASON",
							 | 
						|||
| 
								 | 
							
								                columns: table => new
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    HIDDEN_DANGER_CONFIRM_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    REASON_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_HIDDEN_DANGER_CONFIRM_REASON", x => x.ID);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_SK_HIDDEN_DANGER_CONFIRM_REASON_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_HIDDEN_DANGER_CONFIRM_REASON_T_SK_HIDDEN_DANGER_CONFIRM_HIDDEN_DANGER_CONFIRM_ID",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.HIDDEN_DANGER_CONFIRM_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_SK_HIDDEN_DANGER_CONFIRM",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_SK_HIDDEN_DANGER_CONFIRM_REASON_T_SK_HIDDEN_REASON_REASON_ID",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.REASON_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_SK_HIDDEN_REASON",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                });
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON",
							 | 
						|||
| 
								 | 
							
								                columns: table => new
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    REASON_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_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON", x => x.ID);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON_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_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON_T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL~",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON_T_SK_HIDDEN_REASON_REASON_ID",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.REASON_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_SK_HIDDEN_REASON",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                });
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_SK_HIDDEN_DANGER_RECTIFY_RECORD_REASON",
							 | 
						|||
| 
								 | 
							
								                columns: table => new
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    HIDDEN_DANGER_RECTIFY_RECORD_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    REASON_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_HIDDEN_DANGER_RECTIFY_RECORD_REASON", x => x.ID);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_SK_HIDDEN_DANGER_RECTIFY_RECORD_REASON_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_HIDDEN_DANGER_RECTIFY_RECORD_REASON_T_SK_HIDDEN_DANGER_RECTIFY_RECORD_HIDDEN_DANGER_RECTIFY_RECORD_ID",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.HIDDEN_DANGER_RECTIFY_RECORD_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_SK_HIDDEN_DANGER_RECTIFY_RECORD",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_SK_HIDDEN_DANGER_RECTIFY_RECORD_REASON_T_SK_HIDDEN_REASON_REASON_ID",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.REASON_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_SK_HIDDEN_REASON",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                });
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON",
							 | 
						|||
| 
								 | 
							
								                columns: table => new
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    HIDDEN_DANGER_REPORT_DETAIL_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    REASON_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_HIDDEN_DANGER_REPORT_DETAIL_REASON", x => x.ID);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON_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_HIDDEN_DANGER_REPORT_DETAIL_REASON_T_SK_HIDDEN_DANGER_REPORT_DETAIL_HIDDEN_DANGER_REPORT_DETAIL_ID",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.HIDDEN_DANGER_REPORT_DETAIL_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_SK_HIDDEN_DANGER_REPORT_DETAIL",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON_T_SK_HIDDEN_REASON_REASON_ID",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.REASON_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_SK_HIDDEN_REASON",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                });
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_SK_SECURITY_INSPECTION_RECORD_DETAIL_REASON",
							 | 
						|||
| 
								 | 
							
								                columns: table => new
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    SECURITY_INSPECTION_RECORD_DETAIL_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    REASON_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_SECURITY_INSPECTION_RECORD_DETAIL_REASON", x => x.ID);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_SK_SECURITY_INSPECTION_RECORD_DETAIL_REASON_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_SECURITY_INSPECTION_RECORD_DETAIL_REASON_T_SK_HIDDEN_REASON_REASON_ID",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.REASON_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_SK_HIDDEN_REASON",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_SK_SECURITY_INSPECTION_RECORD_DETAIL_REASON_T_SK_SECURITY_INSPECTION_RECORD_DETAIL_SECURITY_INSPECTION_RECORD_DETAIL_ID",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.SECURITY_INSPECTION_RECORD_DETAIL_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_SK_SECURITY_INSPECTION_RECORD_DETAIL",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                });
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_REASON",
							 | 
						|||
| 
								 | 
							
								                columns: table => new
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
							 | 
						|||
| 
								 | 
							
								                    REASON_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_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_REASON", x => x.ID);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_REASON_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_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_REASON_T_SK_HIDDEN_REASON_REASON_ID",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.REASON_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_SK_HIDDEN_REASON",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                    table.ForeignKey(
							 | 
						|||
| 
								 | 
							
								                        name: "FK_T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_REASON_T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_SECURITY_INSPECTION_REC~",
							 | 
						|||
| 
								 | 
							
								                        column: x => x.SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_ID,
							 | 
						|||
| 
								 | 
							
								                        principalTable: "T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL",
							 | 
						|||
| 
								 | 
							
								                        principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                        onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								                });
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_HIDDEN_DANGER_CONFIRM_REASON_HIDDEN_DANGER_CONFIRM_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_HIDDEN_DANGER_CONFIRM_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "HIDDEN_DANGER_CONFIRM_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_HIDDEN_DANGER_CONFIRM_REASON_ORG_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_HIDDEN_DANGER_CONFIRM_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "ORG_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_HIDDEN_DANGER_CONFIRM_REASON_REASON_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_HIDDEN_DANGER_CONFIRM_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "REASON_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON_ORG_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "ORG_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON_REASON_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "REASON_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_HIDDEN_DANGER_RECTIFY_RECORD_REASON_HIDDEN_DANGER_RECTIFY_RECORD_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_HIDDEN_DANGER_RECTIFY_RECORD_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "HIDDEN_DANGER_RECTIFY_RECORD_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_HIDDEN_DANGER_RECTIFY_RECORD_REASON_ORG_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_HIDDEN_DANGER_RECTIFY_RECORD_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "ORG_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_HIDDEN_DANGER_RECTIFY_RECORD_REASON_REASON_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_HIDDEN_DANGER_RECTIFY_RECORD_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "REASON_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON_HIDDEN_DANGER_REPORT_DETAIL_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "HIDDEN_DANGER_REPORT_DETAIL_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON_ORG_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "ORG_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON_REASON_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "REASON_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_HIDDEN_REASON_ORG_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_HIDDEN_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "ORG_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_SECURITY_INSPECTION_RECORD_DETAIL_REASON_ORG_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_SECURITY_INSPECTION_RECORD_DETAIL_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "ORG_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_SECURITY_INSPECTION_RECORD_DETAIL_REASON_REASON_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_SECURITY_INSPECTION_RECORD_DETAIL_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "REASON_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_SECURITY_INSPECTION_RECORD_DETAIL_REASON_SECURITY_INSPECTION_RECORD_DETAIL_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_SECURITY_INSPECTION_RECORD_DETAIL_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "SECURITY_INSPECTION_RECORD_DETAIL_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_REASON_ORG_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "ORG_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_REASON_REASON_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "REASON_ID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_REASON_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_REASON",
							 | 
						|||
| 
								 | 
							
								                column: "SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_ID");
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        protected override void Down(MigrationBuilder migrationBuilder)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.DropTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_SK_HIDDEN_DANGER_CONFIRM_REASON");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.DropTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_SK_HIDDEN_DANGER_RECTIFY_NOTICE_DETAIL_REASON");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.DropTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_SK_HIDDEN_DANGER_RECTIFY_RECORD_REASON");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.DropTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_SK_HIDDEN_DANGER_REPORT_DETAIL_REASON");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.DropTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_SK_SECURITY_INSPECTION_RECORD_DETAIL_REASON");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.DropTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_SK_SECURITY_INSPECTION_RECORD_SUMMARY_DETAIL_REASON");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.DropTable(
							 | 
						|||
| 
								 | 
							
								                name: "T_SK_HIDDEN_REASON");
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |