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(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), SchoolCode = table.Column(type: "nvarchar(100)", nullable: true, comment: "学校编号"), ActivitiesName = table.Column(type: "nvarchar(100)", nullable: true, comment: "赛事名称"), CategoryId = table.Column(type: "int", nullable: false, comment: "测试类别Id"), CategoryName = table.Column(type: "nvarchar(100)", nullable: true, comment: "类别名称"), Participants = table.Column(type: "nvarchar(max)", nullable: true, comment: "参赛对象"), ActivitiesStatus = table.Column(type: "int", nullable: false, comment: "状态"), StartDate = table.Column(type: "datetime", nullable: false, comment: "活动开始时间"), EndDate = table.Column(type: "datetime", nullable: false, comment: "活动结束时间"), ImagePath = table.Column(type: "nvarchar(2000)", nullable: true, comment: "图片路径"), Creator = table.Column(type: "int", nullable: false, comment: "创建人"), CreateDate = table.Column(type: "datetime", nullable: true, comment: "创建时间"), Modifier = table.Column(type: "int", nullable: false, comment: "修改人"), ModifyDate = table.Column(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(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), SchoolCode = table.Column(type: "nvarchar(100)", nullable: true, comment: "学校编号"), GradeId = table.Column(type: "int", nullable: false, comment: "年级Id"), GradeName = table.Column(type: "nvarchar(100)", nullable: true, comment: "年级名称"), ClassId = table.Column(type: "int", nullable: false, comment: "班级Id"), ClassName = table.Column(type: "nvarchar(100)", nullable: true, comment: "班级名称"), StudentNo = table.Column(type: "nvarchar(100)", nullable: true, comment: "学生学号"), StudentName = table.Column(type: "nvarchar(100)", nullable: true, comment: "学生名称"), Sex = table.Column(type: "int", nullable: false, comment: "性别"), Photo = table.Column(type: "nvarchar(2000)", nullable: true, comment: "学生照片"), G_ActivitiesId = table.Column(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"); } } }