161 lines
5.7 KiB
C#
161 lines
5.7 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using System;
|
|
|
|
#nullable disable
|
|
|
|
namespace VOL.Core.Migrations
|
|
{
|
|
public partial class init030 : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "SportsTestId",
|
|
table: "I_SportsTestData",
|
|
type: "int",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "ClassId",
|
|
table: "Ai_Result",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0,
|
|
comment: "班级Id");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "ClassName",
|
|
table: "Ai_Result",
|
|
type: "nvarchar(100)",
|
|
nullable: true,
|
|
comment: "班级名称");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "GradeId",
|
|
table: "Ai_Result",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0,
|
|
comment: "年级Id");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "GradeName",
|
|
table: "Ai_Result",
|
|
type: "nvarchar(100)",
|
|
nullable: true,
|
|
comment: "年级名称");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "SchoolCode",
|
|
table: "Ai_Result",
|
|
type: "nvarchar(100)",
|
|
nullable: true,
|
|
comment: "学校Code");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "SchoolName",
|
|
table: "Ai_Result",
|
|
type: "nvarchar(100)",
|
|
nullable: true,
|
|
comment: "学校名称");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "TeacherId",
|
|
table: "Ai_Result",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0,
|
|
comment: "老师Id");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "TeacherName",
|
|
table: "Ai_Result",
|
|
type: "nvarchar(100)",
|
|
nullable: true,
|
|
comment: "老师姓名");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "I_SportsTest",
|
|
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: "学校Code"),
|
|
SchoolName = 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: "班级名称"),
|
|
TeacherId = table.Column<int>(type: "int", nullable: true, comment: "老师Id"),
|
|
TeacherName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "老师姓名"),
|
|
ScoreTime = table.Column<DateTime>(type: "datetime", nullable: false, comment: "提交时间")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_I_SportsTest", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_I_SportsTestData_SportsTestId",
|
|
table: "I_SportsTestData",
|
|
column: "SportsTestId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_I_SportsTestData_I_SportsTest_SportsTestId",
|
|
table: "I_SportsTestData",
|
|
column: "SportsTestId",
|
|
principalTable: "I_SportsTest",
|
|
principalColumn: "Id");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_I_SportsTestData_I_SportsTest_SportsTestId",
|
|
table: "I_SportsTestData");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "I_SportsTest");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_I_SportsTestData_SportsTestId",
|
|
table: "I_SportsTestData");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "SportsTestId",
|
|
table: "I_SportsTestData");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "ClassId",
|
|
table: "Ai_Result");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "ClassName",
|
|
table: "Ai_Result");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "GradeId",
|
|
table: "Ai_Result");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "GradeName",
|
|
table: "Ai_Result");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "SchoolCode",
|
|
table: "Ai_Result");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "SchoolName",
|
|
table: "Ai_Result");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "TeacherId",
|
|
table: "Ai_Result");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "TeacherName",
|
|
table: "Ai_Result");
|
|
}
|
|
}
|
|
} |