YD_SmartSports.Api/VOL.Core/Migrations/20260722034330_20260722StudentPromotion.cs

83 lines
3.9 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace VOL.Core.Migrations
{
public partial class _20260722StudentPromotion : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "S_StudentPromotionBatch",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
SchoolCode = table.Column<string>(type: "nvarchar(100)", nullable: true),
SchoolNatureId = table.Column<int>(type: "int", nullable: false),
SchoolNatureName = table.Column<string>(type: "nvarchar(100)", nullable: true),
AcademicYear = table.Column<string>(type: "nvarchar(20)", nullable: true),
Status = table.Column<int>(type: "int", nullable: false),
PromotedCount = table.Column<int>(type: "int", nullable: false),
GraduatedCount = table.Column<int>(type: "int", nullable: false),
OperatorId = table.Column<int>(type: "int", nullable: false),
CreateDate = table.Column<DateTime>(type: "datetime", nullable: false),
RevokeOperatorId = table.Column<int>(type: "int", nullable: true),
RevokeDate = table.Column<DateTime>(type: "datetime", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_S_StudentPromotionBatch", x => x.Id);
});
migrationBuilder.CreateTable(
name: "S_StudentPromotionDetail",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
BatchId = table.Column<long>(type: "bigint", nullable: false),
StudentId = table.Column<int>(type: "int", nullable: false),
OriginalClassId = table.Column<int>(type: "int", nullable: false),
OriginalClassName = table.Column<string>(type: "nvarchar(100)", nullable: true),
OriginalStatus = table.Column<int>(type: "int", nullable: false),
OriginalAge = table.Column<int>(type: "int", nullable: false),
TargetClassId = table.Column<int>(type: "int", nullable: false),
TargetClassName = table.Column<string>(type: "nvarchar(100)", nullable: true),
TargetStatus = table.Column<int>(type: "int", nullable: false),
TargetAge = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_S_StudentPromotionDetail", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_S_StudentPromotionBatch_SchoolCode_AcademicYear",
table: "S_StudentPromotionBatch",
columns: new[] { "SchoolCode", "AcademicYear" });
migrationBuilder.CreateIndex(
name: "IX_S_StudentPromotionDetail_BatchId",
table: "S_StudentPromotionDetail",
column: "BatchId");
migrationBuilder.CreateIndex(
name: "IX_S_StudentPromotionDetail_StudentId",
table: "S_StudentPromotionDetail",
column: "StudentId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "S_StudentPromotionBatch");
migrationBuilder.DropTable(
name: "S_StudentPromotionDetail");
}
}
}