YD_SmartSports.Api/VOL.Core/Migrations/20240422140429_init004.cs
2025-06-06 16:00:39 +08:00

70 lines
2.9 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
using System;
#nullable disable
namespace VOL.Core.Migrations
{
public partial class init004 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "S_SchoolNatureAssocGrade");
migrationBuilder.AddColumn<int>(
name: "SchoolNatureId",
table: "S_School",
type: "int",
nullable: false,
defaultValue: 0,
comment: "学校性质Id");
migrationBuilder.CreateTable(
name: "S_SchoolAssocGrade",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
SchoolId = table.Column<int>(type: "int", nullable: false, comment: "学校Id"),
GradeId = table.Column<int>(type: "int", nullable: false, comment: "年级Id"),
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_SchoolAssocGrade", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "S_SchoolAssocGrade");
migrationBuilder.DropColumn(
name: "SchoolNatureId",
table: "S_School");
migrationBuilder.CreateTable(
name: "S_SchoolNatureAssocGrade",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
CreateDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "创建时间"),
Creator = table.Column<int>(type: "int)", nullable: false, comment: "创建人"),
GradeId = table.Column<int>(type: "int", nullable: false, comment: "年级Id"),
Modifier = table.Column<int>(type: "int)", nullable: false, comment: "修改人"),
ModifyDate = table.Column<DateTime>(type: "datetime", nullable: true, comment: "修改时间"),
SchoolNatureId = table.Column<int>(type: "int", nullable: false, comment: "学校性质Id")
},
constraints: table =>
{
table.PrimaryKey("PK_S_SchoolNatureAssocGrade", x => x.Id);
});
}
}
}