YD_WeChatApplet.Api/WeChatApplet/Migrations/20261016005034_AddPostureReport.cs

53 lines
2.6 KiB
C#
Raw Normal View History

2026-10-16 09:11:15 +08:00
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace YD_WeChatApplet.Api.Migrations
{
public partial class AddPostureReport : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "WCA_PostureReport",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
SchoolCode = table.Column<string>(type: "nvarchar(100)", nullable: false, comment: "学校编号"),
StudentName = table.Column<string>(type: "nvarchar(100)", nullable: false, comment: "学生姓名"),
StudentNo = table.Column<string>(type: "nvarchar(100)", nullable: false, comment: "学生学号"),
GradeName = table.Column<string>(type: "nvarchar(100)", nullable: false, comment: "年级名称"),
ClassName = table.Column<string>(type: "nvarchar(100)", nullable: false, comment: "班级名称"),
GradeId = table.Column<int>(type: "int", nullable: false, comment: "年级Id"),
ClassId = table.Column<int>(type: "int", nullable: false, comment: "班级Id"),
TeacherId = table.Column<int>(type: "int", nullable: false, comment: "老师Id"),
TeacherName = table.Column<string>(type: "nvarchar(100)", nullable: false, comment: "老师姓名"),
ReportContent = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "报告内容"),
CreateTime = table.Column<DateTime>(type: "datetime", nullable: false, comment: "创建时间")
},
constraints: table =>
{
table.PrimaryKey("PK_WCA_PostureReport", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_WCA_PostureReport_SchoolCode_StudentNo_CreateTime",
table: "WCA_PostureReport",
columns: new[] { "SchoolCode", "StudentNo", "CreateTime" });
migrationBuilder.CreateIndex(
name: "IX_WCA_PostureReport_TeacherId_CreateTime",
table: "WCA_PostureReport",
columns: new[] { "TeacherId", "CreateTime" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "WCA_PostureReport");
}
}
}