using System; using Microsoft.EntityFrameworkCore.Migrations; namespace APT.Data.Migrations.Migrations { public partial class hmr2025120501 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "T_FO_TECH_DISCLOSURE_FILE", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), TECH_DISCLOSURE_FROM_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_TECH_DISCLOSURE_FILE", x => x.ID); table.ForeignKey( name: "FK_T_FO_TECH_DISCLOSURE_FILE_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_TECH_DISCLOSURE_FILE_T_FO_TECH_DISCLOSURE_FROM_TECH_DISCLOSURE_FROM_ID", column: x => x.TECH_DISCLOSURE_FROM_ID, principalTable: "T_FO_TECH_DISCLOSURE_FROM", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_FO_TECH_DISCLOSURE_FILE_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_TECH_DISCLOSURE_FROM_SAFE_FILE", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), TECH_DISCLOSURE_FROM_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_TECH_DISCLOSURE_FROM_SAFE_FILE", x => x.ID); table.ForeignKey( name: "FK_T_FO_TECH_DISCLOSURE_FROM_SAFE_FILE_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_TECH_DISCLOSURE_FROM_SAFE_FILE_T_FO_TECH_DISCLOSURE_FROM_SAFE_TECH_DISCLOSURE_FROM_ID", column: x => x.TECH_DISCLOSURE_FROM_ID, principalTable: "T_FO_TECH_DISCLOSURE_FROM_SAFE", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_FO_TECH_DISCLOSURE_FROM_SAFE_FILE_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_TECH_DISCLOSURE_FROM_TECH_FILE", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), TECH_DISCLOSURE_FROM_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_TECH_DISCLOSURE_FROM_TECH_FILE", x => x.ID); table.ForeignKey( name: "FK_T_FO_TECH_DISCLOSURE_FROM_TECH_FILE_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_TECH_DISCLOSURE_FROM_TECH_FILE_T_FO_TECH_DISCLOSURE_FROM_TECH_TECH_DISCLOSURE_FROM_ID", column: x => x.TECH_DISCLOSURE_FROM_ID, principalTable: "T_FO_TECH_DISCLOSURE_FROM_TECH", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_FO_TECH_DISCLOSURE_FROM_TECH_FILE_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_TECH_DISCLOSURE_FILE_IMG_FILE_ID", table: "T_FO_TECH_DISCLOSURE_FILE", column: "IMG_FILE_ID"); migrationBuilder.CreateIndex( name: "IX_T_FO_TECH_DISCLOSURE_FILE_ORG_ID", table: "T_FO_TECH_DISCLOSURE_FILE", column: "ORG_ID"); migrationBuilder.CreateIndex( name: "IX_T_FO_TECH_DISCLOSURE_FILE_TECH_DISCLOSURE_FROM_ID", table: "T_FO_TECH_DISCLOSURE_FILE", column: "TECH_DISCLOSURE_FROM_ID"); migrationBuilder.CreateIndex( name: "IX_T_FO_TECH_DISCLOSURE_FROM_SAFE_FILE_IMG_FILE_ID", table: "T_FO_TECH_DISCLOSURE_FROM_SAFE_FILE", column: "IMG_FILE_ID"); migrationBuilder.CreateIndex( name: "IX_T_FO_TECH_DISCLOSURE_FROM_SAFE_FILE_ORG_ID", table: "T_FO_TECH_DISCLOSURE_FROM_SAFE_FILE", column: "ORG_ID"); migrationBuilder.CreateIndex( name: "IX_T_FO_TECH_DISCLOSURE_FROM_SAFE_FILE_TECH_DISCLOSURE_FROM_ID", table: "T_FO_TECH_DISCLOSURE_FROM_SAFE_FILE", column: "TECH_DISCLOSURE_FROM_ID"); migrationBuilder.CreateIndex( name: "IX_T_FO_TECH_DISCLOSURE_FROM_TECH_FILE_IMG_FILE_ID", table: "T_FO_TECH_DISCLOSURE_FROM_TECH_FILE", column: "IMG_FILE_ID"); migrationBuilder.CreateIndex( name: "IX_T_FO_TECH_DISCLOSURE_FROM_TECH_FILE_ORG_ID", table: "T_FO_TECH_DISCLOSURE_FROM_TECH_FILE", column: "ORG_ID"); migrationBuilder.CreateIndex( name: "IX_T_FO_TECH_DISCLOSURE_FROM_TECH_FILE_TECH_DISCLOSURE_FROM_ID", table: "T_FO_TECH_DISCLOSURE_FROM_TECH_FILE", column: "TECH_DISCLOSURE_FROM_ID"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "T_FO_TECH_DISCLOSURE_FILE"); migrationBuilder.DropTable( name: "T_FO_TECH_DISCLOSURE_FROM_SAFE_FILE"); migrationBuilder.DropTable( name: "T_FO_TECH_DISCLOSURE_FROM_TECH_FILE"); } } }