YD_SmartSports.Api/VOL.Core/Migrations/20240830022430_init052.cs

79 lines
4.4 KiB
C#
Raw Normal View History

2025-06-06 16:00:39 +08:00
using Microsoft.EntityFrameworkCore.Migrations;
using System;
#nullable disable
namespace VOL.Core.Migrations
{
public partial class init052 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "G_Activities",
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: "学校编号"),
ActivitiesName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "赛事名称"),
CategoryId = table.Column<int>(type: "int", nullable: false, comment: "测试类别Id"),
CategoryName = table.Column<string>(type: "nvarchar(100)", nullable: true, comment: "类别名称"),
Participants = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "参赛对象"),
ActivitiesStatus = table.Column<int>(type: "int", nullable: false, comment: "状态"),
StartDate = table.Column<DateTime>(type: "datetime", nullable: false, comment: "活动开始时间"),
EndDate = table.Column<DateTime>(type: "datetime", nullable: false, comment: "活动结束时间"),
ImagePath = table.Column<string>(type: "nvarchar(2000)", 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_G_Activities", x => x.Id);
});
migrationBuilder.CreateTable(
name: "G_EntryStudent",
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: "学校编号"),
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: "班级名称"),
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: "学生照片"),
G_ActivitiesId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_G_EntryStudent", x => x.Id);
table.ForeignKey(
name: "FK_G_EntryStudent_G_Activities_G_ActivitiesId",
column: x => x.G_ActivitiesId,
principalTable: "G_Activities",
principalColumn: "Id");
});
migrationBuilder.CreateIndex(
name: "IX_G_EntryStudent_G_ActivitiesId",
table: "G_EntryStudent",
column: "G_ActivitiesId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "G_EntryStudent");
migrationBuilder.DropTable(
name: "G_Activities");
}
}
}