mh_jy_safe/APT.Data.Migrations/Migrations/20251226071720_wyw2025122601.cs
wyw 213e17d208 课件 T_SE_COURSEWEARLIBRARY
三级安全教育 用户 编号 code 10 =>30
2025-12-29 17:23:18 +08:00

233 lines
12 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace APT.Data.Migrations.Migrations
{
public partial class wyw2025122601 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "CODE",
table: "T_SE_NEW_USER_DETAIL",
type: "nvarchar(30)",
maxLength: 30,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(10)",
oldMaxLength: 10,
oldNullable: true);
migrationBuilder.CreateTable(
name: "T_SE_COURSEWEARLIBRARY",
columns: table => new
{
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
NAME = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
CODE = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true),
DEPARTMENTID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
USER_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
FILE_DB_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
FILE_PATH = table.Column<string>(type: "nvarchar(200)", maxLength: 200, 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_SE_COURSEWEARLIBRARY", x => x.ID);
table.ForeignKey(
name: "FK_T_SE_COURSEWEARLIBRARY_T_FM_DEPARTMENT_DEPARTMENTID",
column: x => x.DEPARTMENTID,
principalTable: "T_FM_DEPARTMENT",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_T_SE_COURSEWEARLIBRARY_T_FM_ORGANIZATION_ORG_ID",
column: x => x.ORG_ID,
principalTable: "T_FM_ORGANIZATION",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_T_SE_COURSEWEARLIBRARY_T_FM_USER_USER_ID",
column: x => x.USER_ID,
principalTable: "T_FM_USER",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_T_SE_COURSEWEARLIBRARY_T_PF_FILE_DB_FILE_DB_ID",
column: x => x.FILE_DB_ID,
principalTable: "T_PF_FILE_DB",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "T_SE_COURSEWEARLIBRARY_DETAIL",
columns: table => new
{
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
EDU_CARD_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
NUM = table.Column<int>(type: "int", nullable: false),
TEST_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
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_SE_COURSEWEARLIBRARY_DETAIL", x => x.ID);
table.ForeignKey(
name: "FK_T_SE_COURSEWEARLIBRARY_DETAIL_T_FM_ORGANIZATION_ORG_ID",
column: x => x.ORG_ID,
principalTable: "T_FM_ORGANIZATION",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_T_SE_COURSEWEARLIBRARY_DETAIL_T_SE_COURSEWEARLIBRARY_EDU_CARD_ID",
column: x => x.EDU_CARD_ID,
principalTable: "T_SE_COURSEWEARLIBRARY",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_T_SE_COURSEWEARLIBRARY_DETAIL_T_SE_TEST_TEST_ID",
column: x => x.TEST_ID,
principalTable: "T_SE_TEST",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "T_SE_COURSEWEARLIBRARY_FILE",
columns: table => new
{
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
COURSEWEARLIBRARY_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
IMG_FILE_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
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_SE_COURSEWEARLIBRARY_FILE", x => x.ID);
table.ForeignKey(
name: "FK_T_SE_COURSEWEARLIBRARY_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_SE_COURSEWEARLIBRARY_FILE_T_PF_IMG_FILE_IMG_FILE_ID",
column: x => x.IMG_FILE_ID,
principalTable: "T_PF_IMG_FILE",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_T_SE_COURSEWEARLIBRARY_FILE_T_SE_COURSEWEARLIBRARY_COURSEWEARLIBRARY_ID",
column: x => x.COURSEWEARLIBRARY_ID,
principalTable: "T_SE_COURSEWEARLIBRARY",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_T_SE_COURSEWEARLIBRARY_DEPARTMENTID",
table: "T_SE_COURSEWEARLIBRARY",
column: "DEPARTMENTID");
migrationBuilder.CreateIndex(
name: "IX_T_SE_COURSEWEARLIBRARY_FILE_DB_ID",
table: "T_SE_COURSEWEARLIBRARY",
column: "FILE_DB_ID");
migrationBuilder.CreateIndex(
name: "IX_T_SE_COURSEWEARLIBRARY_ORG_ID",
table: "T_SE_COURSEWEARLIBRARY",
column: "ORG_ID");
migrationBuilder.CreateIndex(
name: "IX_T_SE_COURSEWEARLIBRARY_USER_ID",
table: "T_SE_COURSEWEARLIBRARY",
column: "USER_ID");
migrationBuilder.CreateIndex(
name: "IX_T_SE_COURSEWEARLIBRARY_DETAIL_EDU_CARD_ID",
table: "T_SE_COURSEWEARLIBRARY_DETAIL",
column: "EDU_CARD_ID");
migrationBuilder.CreateIndex(
name: "IX_T_SE_COURSEWEARLIBRARY_DETAIL_ORG_ID",
table: "T_SE_COURSEWEARLIBRARY_DETAIL",
column: "ORG_ID");
migrationBuilder.CreateIndex(
name: "IX_T_SE_COURSEWEARLIBRARY_DETAIL_TEST_ID",
table: "T_SE_COURSEWEARLIBRARY_DETAIL",
column: "TEST_ID");
migrationBuilder.CreateIndex(
name: "IX_T_SE_COURSEWEARLIBRARY_FILE_COURSEWEARLIBRARY_ID",
table: "T_SE_COURSEWEARLIBRARY_FILE",
column: "COURSEWEARLIBRARY_ID");
migrationBuilder.CreateIndex(
name: "IX_T_SE_COURSEWEARLIBRARY_FILE_IMG_FILE_ID",
table: "T_SE_COURSEWEARLIBRARY_FILE",
column: "IMG_FILE_ID");
migrationBuilder.CreateIndex(
name: "IX_T_SE_COURSEWEARLIBRARY_FILE_ORG_ID",
table: "T_SE_COURSEWEARLIBRARY_FILE",
column: "ORG_ID");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "T_SE_COURSEWEARLIBRARY_DETAIL");
migrationBuilder.DropTable(
name: "T_SE_COURSEWEARLIBRARY_FILE");
migrationBuilder.DropTable(
name: "T_SE_COURSEWEARLIBRARY");
migrationBuilder.AlterColumn<string>(
name: "CODE",
table: "T_SE_NEW_USER_DETAIL",
type: "nvarchar(10)",
maxLength: 10,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(30)",
oldMaxLength: 30,
oldNullable: true);
}
}
}