mh_jy_safe/APT.Data.Migrations/Migrations/20251128031047_wyw2025112801.cs

99 lines
3.5 KiB
C#
Raw Normal View History

using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace APT.Data.Migrations.Migrations
{
public partial class wyw2025112801 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "ENABLE_STATUS",
table: "T_SE_TRAIN_RECORD_USER",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "EXAMETIMES",
table: "T_SE_TRAIN_RECORD_USER",
type: "int",
nullable: false,
defaultValue: 1);
migrationBuilder.AddColumn<Guid>(
name: "RECORD_UUSER_ID",
table: "T_SE_TRAIN_RECORD_PAPER",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "USER_ID_TEACHER",
table: "T_SE_TRAIN_NOTIFY",
type: "uniqueidentifier",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_T_SE_TRAIN_RECORD_PAPER_RECORD_UUSER_ID",
table: "T_SE_TRAIN_RECORD_PAPER",
column: "RECORD_UUSER_ID");
migrationBuilder.CreateIndex(
name: "IX_T_SE_TRAIN_NOTIFY_USER_ID_TEACHER",
table: "T_SE_TRAIN_NOTIFY",
column: "USER_ID_TEACHER");
migrationBuilder.AddForeignKey(
name: "FK_T_SE_TRAIN_NOTIFY_T_FM_USER_USER_ID_TEACHER",
table: "T_SE_TRAIN_NOTIFY",
column: "USER_ID_TEACHER",
principalTable: "T_FM_USER",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_T_SE_TRAIN_RECORD_PAPER_T_SE_TRAIN_RECORD_USER_RECORD_UUSER_ID",
table: "T_SE_TRAIN_RECORD_PAPER",
column: "RECORD_UUSER_ID",
principalTable: "T_SE_TRAIN_RECORD_USER",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_T_SE_TRAIN_NOTIFY_T_FM_USER_USER_ID_TEACHER",
table: "T_SE_TRAIN_NOTIFY");
migrationBuilder.DropForeignKey(
name: "FK_T_SE_TRAIN_RECORD_PAPER_T_SE_TRAIN_RECORD_USER_RECORD_UUSER_ID",
table: "T_SE_TRAIN_RECORD_PAPER");
migrationBuilder.DropIndex(
name: "IX_T_SE_TRAIN_RECORD_PAPER_RECORD_UUSER_ID",
table: "T_SE_TRAIN_RECORD_PAPER");
migrationBuilder.DropIndex(
name: "IX_T_SE_TRAIN_NOTIFY_USER_ID_TEACHER",
table: "T_SE_TRAIN_NOTIFY");
migrationBuilder.DropColumn(
name: "ENABLE_STATUS",
table: "T_SE_TRAIN_RECORD_USER");
migrationBuilder.DropColumn(
name: "EXAMETIMES",
table: "T_SE_TRAIN_RECORD_USER");
migrationBuilder.DropColumn(
name: "RECORD_UUSER_ID",
table: "T_SE_TRAIN_RECORD_PAPER");
migrationBuilder.DropColumn(
name: "USER_ID_TEACHER",
table: "T_SE_TRAIN_NOTIFY");
}
}
}