YD_SmartSports.Api/VOL.Core/Migrations/20241004134607_init077.cs

116 lines
7.0 KiB
C#
Raw Permalink Normal View History

2025-06-06 16:00:39 +08:00
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace VOL.Core.Migrations
{
public partial class init077 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "S_HomeWork",
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: true, comment: "学校编号"),
WorkName = table.Column<string>(type: "nvarchar(200)", nullable: true, comment: "作业名称"),
WorkText = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "作业内容"),
WorkType = table.Column<int>(type: "int", nullable: false, comment: "作业类型"),
WorkStatus = table.Column<int>(type: "int", nullable: false, comment: "作业状态"),
StudentScope = table.Column<int>(type: "int", nullable: false, comment: "学生范围"),
TeacherId = table.Column<int>(type: "int", nullable: false, comment: "老师Id"),
TeacherName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "老师名称"),
GradeId = table.Column<int>(type: "int", nullable: false, comment: "年级Id"),
GradeName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "年级名称"),
ClassId = table.Column<int>(type: "int", nullable: false, comment: "班级Id"),
ClassName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "班级名称"),
StartTime = table.Column<DateTime>(type: "datetime", nullable: false, comment: "开始时间"),
EndTime = table.Column<DateTime>(type: "datetime", nullable: false, comment: "结束时间"),
Remarks = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "备注"),
Creator = table.Column<int>(type: "int", nullable: false, comment: "创建人"),
CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
Modifier = table.Column<int>(type: "int", nullable: false, comment: "修改人"),
ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间")
},
constraints: table =>
{
table.PrimaryKey("PK_S_HomeWork", x => x.Id);
});
migrationBuilder.CreateTable(
name: "S_SubmittedAssignments",
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: true, comment: "学校编号"),
HomeWorkId = table.Column<int>(type: "int", nullable: false, comment: "作业Id"),
StudentNo = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "学生学号"),
FileType = table.Column<int>(type: "int", nullable: false, comment: "文件类型"),
FileSize = table.Column<int>(type: "int", nullable: true, comment: "文件大小"),
FileName = table.Column<string>(type: "nvarchar(200)", nullable: true, comment: "文件名称"),
FilePath = table.Column<string>(type: "nvarchar(2000)", nullable: true, comment: "文件地址"),
Remarks = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "备注"),
Creator = table.Column<int>(type: "int", nullable: false, comment: "创建人"),
CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
Modifier = table.Column<int>(type: "int", nullable: false, comment: "修改人"),
ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间")
},
constraints: table =>
{
table.PrimaryKey("PK_S_SubmittedAssignments", x => x.Id);
});
migrationBuilder.CreateTable(
name: "S_HomeWorkStudents",
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: true, comment: "学校编号"),
StudentNo = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "学生学号"),
StudentName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "学生名称"),
Sex = table.Column<int>(type: "int", nullable: false, comment: "性别"),
Photo = table.Column<string>(type: "nvarchar(2000)", nullable: true, comment: "学生照片"),
WorkStatus = table.Column<int>(type: "int", nullable: false, comment: "学生作业状态"),
Remarks = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "备注"),
Creator = table.Column<int>(type: "int", nullable: false, comment: "创建人"),
CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
Modifier = table.Column<int>(type: "int", nullable: false, comment: "修改人"),
ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
HomeWorkId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_S_HomeWorkStudents", x => x.Id);
table.ForeignKey(
name: "FK_S_HomeWorkStudents_S_HomeWork_HomeWorkId",
column: x => x.HomeWorkId,
principalTable: "S_HomeWork",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_S_HomeWorkStudents_HomeWorkId",
table: "S_HomeWorkStudents",
column: "HomeWorkId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "S_HomeWorkStudents");
migrationBuilder.DropTable(
name: "S_SubmittedAssignments");
migrationBuilder.DropTable(
name: "S_HomeWork");
}
}
}