YD_SmartSports.Api/VOL.Core/Migrations/20240824152333_init045.cs

70 lines
2.2 KiB
C#
Raw Permalink Normal View History

2025-06-06 16:00:39 +08:00
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace VOL.Core.Migrations
{
public partial class init045 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Ai_SpecialUnit_Ai_Special_SpecialId",
table: "Ai_SpecialUnit");
migrationBuilder.AlterColumn<int>(
name: "SpecialId",
table: "Ai_SpecialUnit",
type: "int",
nullable: false,
defaultValue: 0,
comment: "专项Id",
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AddColumn<int>(
name: "Subjects",
table: "Ai_SpecialUnit",
type: "int",
nullable: false,
defaultValue: 0,
comment: "科目");
migrationBuilder.AddForeignKey(
name: "FK_Ai_SpecialUnit_Ai_Special_SpecialId",
table: "Ai_SpecialUnit",
column: "SpecialId",
principalTable: "Ai_Special",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Ai_SpecialUnit_Ai_Special_SpecialId",
table: "Ai_SpecialUnit");
migrationBuilder.DropColumn(
name: "Subjects",
table: "Ai_SpecialUnit");
migrationBuilder.AlterColumn<int>(
name: "SpecialId",
table: "Ai_SpecialUnit",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int",
oldComment: "专项Id");
migrationBuilder.AddForeignKey(
name: "FK_Ai_SpecialUnit_Ai_Special_SpecialId",
table: "Ai_SpecialUnit",
column: "SpecialId",
principalTable: "Ai_Special",
principalColumn: "Id");
}
}
}