using System; using Microsoft.EntityFrameworkCore.Migrations; namespace APT.Data.Migrations.Migrations { public partial class hmr2025111901 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "T_SK_CHECK_SET_USER", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), CHECK_SET_ID = table.Column(type: "uniqueidentifier", nullable: false), USER_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_CHECK_SET_USER", x => x.ID); table.ForeignKey( name: "FK_T_SK_CHECK_SET_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_SK_CHECK_SET_USER_T_FM_USER_USER_ID", column: x => x.USER_ID, principalTable: "T_FM_USER", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_SK_CHECK_SET_USER_T_SK_CHECK_SET_CHECK_SET_ID", column: x => x.CHECK_SET_ID, principalTable: "T_SK_CHECK_SET", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_USER", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), ENTERPRISE_LIBRARY_DETAIL_CONTENT_DEPART_ID = table.Column(type: "uniqueidentifier", nullable: false), USER_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_ENTERPRISE_LIBRARY_DETAIL_CONTENT_USER", x => x.ID); table.ForeignKey( name: "FK_T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_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_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_USER_T_FM_USER_USER_ID", column: x => x.USER_ID, principalTable: "T_FM_USER", principalColumn: "ID", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_USER_T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_DEPART_ENTERPRISE_LIBRARY_DETAIL_CONTENT_~", column: x => x.ENTERPRISE_LIBRARY_DETAIL_CONTENT_DEPART_ID, principalTable: "T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_DEPART", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_T_SK_CHECK_SET_USER_CHECK_SET_ID", table: "T_SK_CHECK_SET_USER", column: "CHECK_SET_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_CHECK_SET_USER_ORG_ID", table: "T_SK_CHECK_SET_USER", column: "ORG_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_CHECK_SET_USER_USER_ID", table: "T_SK_CHECK_SET_USER", column: "USER_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_USER_ENTERPRISE_LIBRARY_DETAIL_CONTENT_DEPART_ID", table: "T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_USER", column: "ENTERPRISE_LIBRARY_DETAIL_CONTENT_DEPART_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_USER_ORG_ID", table: "T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_USER", column: "ORG_ID"); migrationBuilder.CreateIndex( name: "IX_T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_USER_USER_ID", table: "T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_USER", column: "USER_ID"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "T_SK_CHECK_SET_USER"); migrationBuilder.DropTable( name: "T_SK_ENTERPRISE_LIBRARY_DETAIL_CONTENT_USER"); } } }