49 lines
1.6 KiB
C#
49 lines
1.6 KiB
C#
![]() |
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace VOL.Core.Migrations
|
|||
|
{
|
|||
|
public partial class init083 : Migration
|
|||
|
{
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.AddColumn<int>(
|
|||
|
name: "Age",
|
|||
|
table: "Ai_ClassroomStudentRecord",
|
|||
|
type: "int",
|
|||
|
nullable: false,
|
|||
|
defaultValue: 0,
|
|||
|
comment: "年龄");
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_Ai_ClassroomStudentRecord_ClassRoomRecordId",
|
|||
|
table: "Ai_ClassroomStudentRecord",
|
|||
|
column: "ClassRoomRecordId");
|
|||
|
|
|||
|
migrationBuilder.AddForeignKey(
|
|||
|
name: "FK_Ai_ClassroomStudentRecord_Ai_ClassRoomRecord_ClassRoomRecordId",
|
|||
|
table: "Ai_ClassroomStudentRecord",
|
|||
|
column: "ClassRoomRecordId",
|
|||
|
principalTable: "Ai_ClassRoomRecord",
|
|||
|
principalColumn: "Id",
|
|||
|
onDelete: ReferentialAction.Cascade);
|
|||
|
}
|
|||
|
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropForeignKey(
|
|||
|
name: "FK_Ai_ClassroomStudentRecord_Ai_ClassRoomRecord_ClassRoomRecordId",
|
|||
|
table: "Ai_ClassroomStudentRecord");
|
|||
|
|
|||
|
migrationBuilder.DropIndex(
|
|||
|
name: "IX_Ai_ClassroomStudentRecord_ClassRoomRecordId",
|
|||
|
table: "Ai_ClassroomStudentRecord");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "Age",
|
|||
|
table: "Ai_ClassroomStudentRecord");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|