mh_jy_safe/APT.Data.Migrations/Migrations/20251219062203_wyw2025121901.cs
wyw 3a0cc7e335 三级安全教育修改 考试 未通过继续考试 添加考试 单据
责任状 签订 判断 是否有了 再生成
培训老师 多选   培训形式修改
生成试题 添加公共方法
AOP金能昆仑  数据库名称修改
2025-12-25 10:40:23 +08:00

108 lines
4.5 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace APT.Data.Migrations.Migrations
{
public partial class wyw2025121901 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "TEACHER",
table: "T_SE_NEW_USERS");
migrationBuilder.DropColumn(
name: "TRAIN_MODEL",
table: "T_SE_NEW_USERS");
migrationBuilder.AddColumn<int>(
name: "TRAINTYPE",
table: "T_SE_NEW_USERS",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateTable(
name: "T_SE_NEW_USERS_TEACHER",
columns: table => new
{
ID = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
NEW_USERS_ID = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
USER_ID = table.Column<Guid>(type: "uniqueidentifier", 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_NEW_USERS_TEACHER", x => x.ID);
table.ForeignKey(
name: "FK_T_SE_NEW_USERS_TEACHER_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_NEW_USERS_TEACHER_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_NEW_USERS_TEACHER_T_SE_NEW_USERS_NEW_USERS_ID",
column: x => x.NEW_USERS_ID,
principalTable: "T_SE_NEW_USERS",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_T_SE_NEW_USERS_TEACHER_NEW_USERS_ID",
table: "T_SE_NEW_USERS_TEACHER",
column: "NEW_USERS_ID");
migrationBuilder.CreateIndex(
name: "IX_T_SE_NEW_USERS_TEACHER_ORG_ID",
table: "T_SE_NEW_USERS_TEACHER",
column: "ORG_ID");
migrationBuilder.CreateIndex(
name: "IX_T_SE_NEW_USERS_TEACHER_USER_ID",
table: "T_SE_NEW_USERS_TEACHER",
column: "USER_ID");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "T_SE_NEW_USERS_TEACHER");
migrationBuilder.DropColumn(
name: "TRAINTYPE",
table: "T_SE_NEW_USERS");
migrationBuilder.AddColumn<string>(
name: "TEACHER",
table: "T_SE_NEW_USERS",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "TRAIN_MODEL",
table: "T_SE_NEW_USERS",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
}
}
}