using System; using Microsoft.EntityFrameworkCore.Migrations; namespace APT.Data.Migrations.Migrations { public partial class hmr2025112103 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "SAFE_USER_NAME", table: "T_OG_RELATED", type: "nvarchar(50)", maxLength: 50, nullable: true); migrationBuilder.AddColumn( name: "SAFE_USER_PHONE", table: "T_OG_RELATED", type: "int", maxLength: 11, nullable: true); migrationBuilder.CreateTable( name: "T_FO_FIRE_JOB_WB_FIRE_USER", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), FIRE_JOB_WB_ID = table.Column(type: "uniqueidentifier", nullable: false), IMG_FILE_ID = table.Column(type: "uniqueidentifier", nullable: false), 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_FO_FIRE_JOB_WB_FIRE_USER", x => x.ID); table.ForeignKey( name: "FK_T_FO_FIRE_JOB_WB_FIRE_USER_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_FIRE_JOB_WB_FIRE_USER_T_FO_FIRE_JOB_WB_FIRE_JOB_WB_ID", column: x => x.FIRE_JOB_WB_ID, principalTable: "T_FO_FIRE_JOB_WB", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_FO_FIRE_JOB_WB_FIRE_USER_T_PF_IMG_FILE_IMG_FILE_ID", column: x => x.IMG_FILE_ID, principalTable: "T_PF_IMG_FILE", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "T_FO_FIRE_JOB_WB_SAFE_USER", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), FIRE_JOB_WB_ID = table.Column(type: "uniqueidentifier", nullable: false), IMG_FILE_ID = table.Column(type: "uniqueidentifier", nullable: false), 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_FO_FIRE_JOB_WB_SAFE_USER", x => x.ID); table.ForeignKey( name: "FK_T_FO_FIRE_JOB_WB_SAFE_USER_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_FIRE_JOB_WB_SAFE_USER_T_FO_FIRE_JOB_WB_FIRE_JOB_WB_ID", column: x => x.FIRE_JOB_WB_ID, principalTable: "T_FO_FIRE_JOB_WB", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_FO_FIRE_JOB_WB_SAFE_USER_T_PF_IMG_FILE_IMG_FILE_ID", column: x => x.IMG_FILE_ID, principalTable: "T_PF_IMG_FILE", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "T_FO_FIRE_JOB_WB_USER_SIGN", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), FIRE_JOB_WB_USER_ID = table.Column(type: "uniqueidentifier", nullable: false), IMG_FILE_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_FO_FIRE_JOB_WB_USER_SIGN", x => x.ID); table.ForeignKey( name: "FK_T_FO_FIRE_JOB_WB_USER_SIGN_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_FIRE_JOB_WB_USER_SIGN_T_FO_FIRE_JOB_WB_USER_FIRE_JOB_WB_USER_ID", column: x => x.FIRE_JOB_WB_USER_ID, principalTable: "T_FO_FIRE_JOB_WB_USER", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_FO_FIRE_JOB_WB_USER_SIGN_T_PF_IMG_FILE_IMG_FILE_ID", column: x => x.IMG_FILE_ID, principalTable: "T_PF_IMG_FILE", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "T_OG_RELATED_FIRE_USER", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), RELATED_ID = table.Column(type: "uniqueidentifier", nullable: false), IMG_FILE_ID = table.Column(type: "uniqueidentifier", nullable: false), 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_OG_RELATED_FIRE_USER", x => x.ID); table.ForeignKey( name: "FK_T_OG_RELATED_FIRE_USER_T_FM_ORGANIZATION_ORG_ID", column: x => x.ORG_ID, principalTable: "T_FM_ORGANIZATION", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_OG_RELATED_FIRE_USER_T_OG_RELATED_RELATED_ID", column: x => x.RELATED_ID, principalTable: "T_OG_RELATED", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_OG_RELATED_FIRE_USER_T_PF_IMG_FILE_IMG_FILE_ID", column: x => x.IMG_FILE_ID, principalTable: "T_PF_IMG_FILE", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "T_OG_RELATED_SAFE_USER", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), RELATED_ID = table.Column(type: "uniqueidentifier", nullable: false), IMG_FILE_ID = table.Column(type: "uniqueidentifier", nullable: false), 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_OG_RELATED_SAFE_USER", x => x.ID); table.ForeignKey( name: "FK_T_OG_RELATED_SAFE_USER_T_FM_ORGANIZATION_ORG_ID", column: x => x.ORG_ID, principalTable: "T_FM_ORGANIZATION", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_OG_RELATED_SAFE_USER_T_OG_RELATED_RELATED_ID", column: x => x.RELATED_ID, principalTable: "T_OG_RELATED", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_OG_RELATED_SAFE_USER_T_PF_IMG_FILE_IMG_FILE_ID", column: x => x.IMG_FILE_ID, principalTable: "T_PF_IMG_FILE", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_T_FO_FIRE_JOB_WB_FIRE_USER_FIRE_JOB_WB_ID", table: "T_FO_FIRE_JOB_WB_FIRE_USER", column: "FIRE_JOB_WB_ID"); migrationBuilder.CreateIndex( name: "IX_T_FO_FIRE_JOB_WB_FIRE_USER_IMG_FILE_ID", table: "T_FO_FIRE_JOB_WB_FIRE_USER", column: "IMG_FILE_ID"); migrationBuilder.CreateIndex( name: "IX_T_FO_FIRE_JOB_WB_FIRE_USER_ORG_ID", table: "T_FO_FIRE_JOB_WB_FIRE_USER", column: "ORG_ID"); migrationBuilder.CreateIndex( name: "IX_T_FO_FIRE_JOB_WB_SAFE_USER_FIRE_JOB_WB_ID", table: "T_FO_FIRE_JOB_WB_SAFE_USER", column: "FIRE_JOB_WB_ID"); migrationBuilder.CreateIndex( name: "IX_T_FO_FIRE_JOB_WB_SAFE_USER_IMG_FILE_ID", table: "T_FO_FIRE_JOB_WB_SAFE_USER", column: "IMG_FILE_ID"); migrationBuilder.CreateIndex( name: "IX_T_FO_FIRE_JOB_WB_SAFE_USER_ORG_ID", table: "T_FO_FIRE_JOB_WB_SAFE_USER", column: "ORG_ID"); migrationBuilder.CreateIndex( name: "IX_T_FO_FIRE_JOB_WB_USER_SIGN_FIRE_JOB_WB_USER_ID", table: "T_FO_FIRE_JOB_WB_USER_SIGN", column: "FIRE_JOB_WB_USER_ID"); migrationBuilder.CreateIndex( name: "IX_T_FO_FIRE_JOB_WB_USER_SIGN_IMG_FILE_ID", table: "T_FO_FIRE_JOB_WB_USER_SIGN", column: "IMG_FILE_ID"); migrationBuilder.CreateIndex( name: "IX_T_FO_FIRE_JOB_WB_USER_SIGN_ORG_ID", table: "T_FO_FIRE_JOB_WB_USER_SIGN", column: "ORG_ID"); migrationBuilder.CreateIndex( name: "IX_T_OG_RELATED_FIRE_USER_IMG_FILE_ID", table: "T_OG_RELATED_FIRE_USER", column: "IMG_FILE_ID"); migrationBuilder.CreateIndex( name: "IX_T_OG_RELATED_FIRE_USER_ORG_ID", table: "T_OG_RELATED_FIRE_USER", column: "ORG_ID"); migrationBuilder.CreateIndex( name: "IX_T_OG_RELATED_FIRE_USER_RELATED_ID", table: "T_OG_RELATED_FIRE_USER", column: "RELATED_ID"); migrationBuilder.CreateIndex( name: "IX_T_OG_RELATED_SAFE_USER_IMG_FILE_ID", table: "T_OG_RELATED_SAFE_USER", column: "IMG_FILE_ID"); migrationBuilder.CreateIndex( name: "IX_T_OG_RELATED_SAFE_USER_ORG_ID", table: "T_OG_RELATED_SAFE_USER", column: "ORG_ID"); migrationBuilder.CreateIndex( name: "IX_T_OG_RELATED_SAFE_USER_RELATED_ID", table: "T_OG_RELATED_SAFE_USER", column: "RELATED_ID"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "T_FO_FIRE_JOB_WB_FIRE_USER"); migrationBuilder.DropTable( name: "T_FO_FIRE_JOB_WB_SAFE_USER"); migrationBuilder.DropTable( name: "T_FO_FIRE_JOB_WB_USER_SIGN"); migrationBuilder.DropTable( name: "T_OG_RELATED_FIRE_USER"); migrationBuilder.DropTable( name: "T_OG_RELATED_SAFE_USER"); migrationBuilder.DropColumn( name: "SAFE_USER_NAME", table: "T_OG_RELATED"); migrationBuilder.DropColumn( name: "SAFE_USER_PHONE", table: "T_OG_RELATED"); } } }