using System; using Microsoft.EntityFrameworkCore.Migrations; namespace APT.Data.Migrations.Migrations { public partial class hmr2025102101 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "T_SK_IDENTIFY_EVALUATION_PLAN_REQUIRE", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), IDENTIFY_EVALUATION_PLAN_ID = table.Column(type: "uniqueidentifier", nullable: false), REQUIRE_ID = table.Column(type: "uniqueidentifier", nullable: true), IS_DELETED = table.Column(type: "bit", nullable: false), ORG_ID = table.Column(type: "uniqueidentifier", nullable: false), ENTITY_ORG_TPYE = table.Column(type: "int", nullable: false), FORM_ID = table.Column(type: "uniqueidentifier", nullable: true), FLOW_STATUS = table.Column(type: "int", nullable: false), FLOW_SEND_STATUS = table.Column(type: "int", nullable: false), FLOW_ID = table.Column(type: "uniqueidentifier", nullable: true), CREATE_TIME = table.Column(type: "datetime2", nullable: true), MODIFY_TIME = table.Column(type: "datetime2", nullable: true), CREATER_ID = table.Column(type: "uniqueidentifier", nullable: true), MODIFIER_ID = table.Column(type: "uniqueidentifier", nullable: true) }, constraints: table => { table.PrimaryKey("PK_T_SK_IDENTIFY_EVALUATION_PLAN_REQUIRE", x => x.ID); table.ForeignKey( name: "FK_T_SK_IDENTIFY_EVALUATION_PLAN_REQUIRE_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_IDENTIFY_EVALUATION_PLAN_REQUIRE_T_SK_IDENTIFY_EVALUATION_PLAN_IDENTIFY_EVALUATION_PLAN_ID", column: x => x.IDENTIFY_EVALUATION_PLAN_ID, principalTable: "T_SK_IDENTIFY_EVALUATION_PLAN", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_SK_IDENTIFY_EVALUATION_PLAN_REQUIRE_T_SK_REQUEST_REQUIRE_ID", column: x => x.REQUIRE_ID, principalTable: "T_SK_REQUEST", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "T_SK_RISK_EVALUATION_REQUIRE", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), RISK_EVALUATION_ID = table.Column(type: "uniqueidentifier", nullable: false), REQUIRE_ID = table.Column(type: "uniqueidentifier", nullable: true), IS_DELETED = table.Column(type: "bit", nullable: false), ORG_ID = table.Column(type: "uniqueidentifier", nullable: false), ENTITY_ORG_TPYE = table.Column(type: "int", nullable: false), FORM_ID = table.Column(type: "uniqueidentifier", nullable: true), FLOW_STATUS = table.Column(type: "int", nullable: false), FLOW_SEND_STATUS = table.Column(type: "int", nullable: false), FLOW_ID = table.Column(type: "uniqueidentifier", nullable: true), CREATE_TIME = table.Column(type: "datetime2", nullable: true), MODIFY_TIME = table.Column(type: "datetime2", nullable: true), CREATER_ID = table.Column(type: "uniqueidentifier", nullable: true), MODIFIER_ID = table.Column(type: "uniqueidentifier", nullable: true) }, constraints: table => { table.PrimaryKey("PK_T_SK_RISK_EVALUATION_REQUIRE", x => x.ID); table.ForeignKey( name: "FK_T_SK_RISK_EVALUATION_REQUIRE_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_RISK_EVALUATION_REQUIRE_T_SK_EVALUATION_REQUIRE_ID", column: x => x.REQUIRE_ID, principalTable: "T_SK_EVALUATION", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_SK_RISK_EVALUATION_REQUIRE_T_SK_RISK_EVALUATION_RISK_EVALUATION_ID", column: x => x.RISK_EVALUATION_ID, principalTable: "T_SK_RISK_EVALUATION", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "T_SK_RISK_EVALUATION_SUMMARY_REQUIRE", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), RISK_EVALUATION_SUMMARY_ID = table.Column(type: "uniqueidentifier", nullable: false), REQUIRE_ID = table.Column(type: "uniqueidentifier", nullable: true), IS_DELETED = table.Column(type: "bit", nullable: false), ORG_ID = table.Column(type: "uniqueidentifier", nullable: false), ENTITY_ORG_TPYE = table.Column(type: "int", nullable: false), FORM_ID = table.Column(type: "uniqueidentifier", nullable: true), FLOW_STATUS = table.Column(type: "int", nullable: false), FLOW_SEND_STATUS = table.Column(type: "int", nullable: false), FLOW_ID = table.Column(type: "uniqueidentifier", nullable: true), CREATE_TIME = table.Column(type: "datetime2", nullable: true), MODIFY_TIME = table.Column(type: "datetime2", nullable: true), CREATER_ID = table.Column(type: "uniqueidentifier", nullable: true), MODIFIER_ID = table.Column(type: "uniqueidentifier", nullable: true) }, constraints: table => { table.PrimaryKey("PK_T_SK_RISK_EVALUATION_SUMMARY_REQUIRE", x => x.ID); table.ForeignKey( name: "FK_T_SK_RISK_EVALUATION_SUMMARY_REQUIRE_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_RISK_EVALUATION_SUMMARY_REQUIRE_T_SK_EVALUATION_REQUIRE_ID", column: x => x.REQUIRE_ID, principalTable: "T_SK_EVALUATION", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_SK_RISK_EVALUATION_SUMMARY_REQUIRE_T_SK_RISK_EVALUATION_SUMMARY_RISK_EVALUATION_SUMMARY_ID", column: x => x.RISK_EVALUATION_SUMMARY_ID, principalTable: "T_SK_RISK_EVALUATION_SUMMARY", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "T_SK_RISK_IDENTIFY_REQUIRE", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), RISK_IDENTIFY_ID = table.Column(type: "uniqueidentifier", nullable: false), REQUIRE_ID = table.Column(type: "uniqueidentifier", nullable: true), IS_DELETED = table.Column(type: "bit", nullable: false), ORG_ID = table.Column(type: "uniqueidentifier", nullable: false), ENTITY_ORG_TPYE = table.Column(type: "int", nullable: false), FORM_ID = table.Column(type: "uniqueidentifier", nullable: true), FLOW_STATUS = table.Column(type: "int", nullable: false), FLOW_SEND_STATUS = table.Column(type: "int", nullable: false), FLOW_ID = table.Column(type: "uniqueidentifier", nullable: true), CREATE_TIME = table.Column(type: "datetime2", nullable: true), MODIFY_TIME = table.Column(type: "datetime2", nullable: true), CREATER_ID = table.Column(type: "uniqueidentifier", nullable: true), MODIFIER_ID = table.Column(type: "uniqueidentifier", nullable: true) }, constraints: table => { table.PrimaryKey("PK_T_SK_RISK_IDENTIFY_REQUIRE", x => x.ID); table.ForeignKey( name: "FK_T_SK_RISK_IDENTIFY_REQUIRE_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_RISK_IDENTIFY_REQUIRE_T_SK_REQUEST_REQUIRE_ID", column: x => x.REQUIRE_ID, principalTable: "T_SK_REQUEST", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_SK_RISK_IDENTIFY_REQUIRE_T_SK_RISK_IDENTIFY_RISK_IDENTIFY_ID", column: x => x.RISK_IDENTIFY_ID, principalTable: "T_SK_RISK_IDENTIFY", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "T_SK_RISK_IDENTIFY_RESULT_REQUIRE", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), RISK_IDENTIFY_RESULT_ID = table.Column(type: "uniqueidentifier", nullable: false), REQUIRE_ID = table.Column(type: "uniqueidentifier", nullable: true), IS_DELETED = table.Column(type: "bit", nullable: false), ORG_ID = table.Column(type: "uniqueidentifier", nullable: false), ENTITY_ORG_TPYE = table.Column(type: "int", nullable: false), FORM_ID = table.Column(type: "uniqueidentifier", nullable: true), FLOW_STATUS = table.Column(type: "int", nullable: false), FLOW_SEND_STATUS = table.Column(type: "int", nullable: false), FLOW_ID = table.Column(type: "uniqueidentifier", nullable: true), CREATE_TIME = table.Column(type: "datetime2", nullable: true), MODIFY_TIME = table.Column(type: "datetime2", nullable: true), CREATER_ID = table.Column(type: "uniqueidentifier", nullable: true), MODIFIER_ID = table.Column(type: "uniqueidentifier", nullable: true) }, constraints: table => { table.PrimaryKey("PK_T_SK_RISK_IDENTIFY_RESULT_REQUIRE", x => x.ID); table.ForeignKey( name: "FK_T_SK_RISK_IDENTIFY_RESULT_REQUIRE_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_RISK_IDENTIFY_RESULT_REQUIRE_T_SK_REQUEST_REQUIRE_ID", column: x => x.REQUIRE_ID, principalTable: "T_SK_REQUEST", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_SK_RISK_IDENTIFY_RESULT_REQUIRE_T_SK_RISK_IDENTIFY_RESULT_RISK_IDENTIFY_RESULT_ID", column: x => x.RISK_IDENTIFY_RESULT_ID, principalTable: "T_SK_RISK_IDENTIFY_RESULT", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "T_SK_RISK_IDENTIFY_RESULT_SUMMARY_REQUIRE", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), IDENTIFY_RESULT_SUMMARY_ID = table.Column(type: "uniqueidentifier", nullable: false), REQUIRE_ID = table.Column(type: "uniqueidentifier", nullable: true), IS_DELETED = table.Column(type: "bit", nullable: false), ORG_ID = table.Column(type: "uniqueidentifier", nullable: false), ENTITY_ORG_TPYE = table.Column(type: "int", nullable: false), FORM_ID = table.Column(type: "uniqueidentifier", nullable: true), FLOW_STATUS = table.Column(type: "int", nullable: false), FLOW_SEND_STATUS = table.Column(type: "int", nullable: false), FLOW_ID = table.Column(type: "uniqueidentifier", nullable: true), CREATE_TIME = table.Column(type: "datetime2", nullable: true), MODIFY_TIME = table.Column(type: "datetime2", nullable: true), CREATER_ID = table.Column(type: "uniqueidentifier", nullable: true), MODIFIER_ID = table.Column(type: "uniqueidentifier", nullable: true) }, constraints: table => { table.PrimaryKey("PK_T_SK_RISK_IDENTIFY_RESULT_SUMMARY_REQUIRE", x => x.ID); table.ForeignKey( name: "FK_T_SK_RISK_IDENTIFY_RESULT_SUMMARY_REQUIRE_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_RISK_IDENTIFY_RESULT_SUMMARY_REQUIRE_T_SK_REQUEST_REQUIRE_ID", column: x => x.REQUIRE_ID, principalTable: "T_SK_REQUEST", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_SK_RISK_IDENTIFY_RESULT_SUMMARY_REQUIRE_T_SK_RISK_IDENTIFY_RESULT_SUMMARY_IDENTIFY_RESULT_SUMMARY_ID", column: x => x.IDENTIFY_RESULT_SUMMARY_ID, principalTable: "T_SK_RISK_IDENTIFY_RESULT_SUMMARY", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_T_SK_IDENTIFY_EVALUATION_PLAN_REQUIRE_IDENTIFY_EVALUATION_PLAN_ID", table: "T_SK_IDENTIFY_EVALUATION_PLAN_REQUIRE", column: "IDENTIFY_EVALUATION_PLAN_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_IDENTIFY_EVALUATION_PLAN_REQUIRE_ORG_ID", table: "T_SK_IDENTIFY_EVALUATION_PLAN_REQUIRE", column: "ORG_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_IDENTIFY_EVALUATION_PLAN_REQUIRE_REQUIRE_ID", table: "T_SK_IDENTIFY_EVALUATION_PLAN_REQUIRE", column: "REQUIRE_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_RISK_EVALUATION_REQUIRE_ORG_ID", table: "T_SK_RISK_EVALUATION_REQUIRE", column: "ORG_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_RISK_EVALUATION_REQUIRE_REQUIRE_ID", table: "T_SK_RISK_EVALUATION_REQUIRE", column: "REQUIRE_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_RISK_EVALUATION_REQUIRE_RISK_EVALUATION_ID", table: "T_SK_RISK_EVALUATION_REQUIRE", column: "RISK_EVALUATION_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_RISK_EVALUATION_SUMMARY_REQUIRE_ORG_ID", table: "T_SK_RISK_EVALUATION_SUMMARY_REQUIRE", column: "ORG_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_RISK_EVALUATION_SUMMARY_REQUIRE_REQUIRE_ID", table: "T_SK_RISK_EVALUATION_SUMMARY_REQUIRE", column: "REQUIRE_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_RISK_EVALUATION_SUMMARY_REQUIRE_RISK_EVALUATION_SUMMARY_ID", table: "T_SK_RISK_EVALUATION_SUMMARY_REQUIRE", column: "RISK_EVALUATION_SUMMARY_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_RISK_IDENTIFY_REQUIRE_ORG_ID", table: "T_SK_RISK_IDENTIFY_REQUIRE", column: "ORG_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_RISK_IDENTIFY_REQUIRE_REQUIRE_ID", table: "T_SK_RISK_IDENTIFY_REQUIRE", column: "REQUIRE_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_RISK_IDENTIFY_REQUIRE_RISK_IDENTIFY_ID", table: "T_SK_RISK_IDENTIFY_REQUIRE", column: "RISK_IDENTIFY_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_RISK_IDENTIFY_RESULT_REQUIRE_ORG_ID", table: "T_SK_RISK_IDENTIFY_RESULT_REQUIRE", column: "ORG_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_RISK_IDENTIFY_RESULT_REQUIRE_REQUIRE_ID", table: "T_SK_RISK_IDENTIFY_RESULT_REQUIRE", column: "REQUIRE_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_RISK_IDENTIFY_RESULT_REQUIRE_RISK_IDENTIFY_RESULT_ID", table: "T_SK_RISK_IDENTIFY_RESULT_REQUIRE", column: "RISK_IDENTIFY_RESULT_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_RISK_IDENTIFY_RESULT_SUMMARY_REQUIRE_IDENTIFY_RESULT_SUMMARY_ID", table: "T_SK_RISK_IDENTIFY_RESULT_SUMMARY_REQUIRE", column: "IDENTIFY_RESULT_SUMMARY_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_RISK_IDENTIFY_RESULT_SUMMARY_REQUIRE_ORG_ID", table: "T_SK_RISK_IDENTIFY_RESULT_SUMMARY_REQUIRE", column: "ORG_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_RISK_IDENTIFY_RESULT_SUMMARY_REQUIRE_REQUIRE_ID", table: "T_SK_RISK_IDENTIFY_RESULT_SUMMARY_REQUIRE", column: "REQUIRE_ID"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "T_SK_IDENTIFY_EVALUATION_PLAN_REQUIRE"); migrationBuilder.DropTable( name: "T_SK_RISK_EVALUATION_REQUIRE"); migrationBuilder.DropTable( name: "T_SK_RISK_EVALUATION_SUMMARY_REQUIRE"); migrationBuilder.DropTable( name: "T_SK_RISK_IDENTIFY_REQUIRE"); migrationBuilder.DropTable( name: "T_SK_RISK_IDENTIFY_RESULT_REQUIRE"); migrationBuilder.DropTable( name: "T_SK_RISK_IDENTIFY_RESULT_SUMMARY_REQUIRE"); } } }