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( name: "SchoolNatureId", table: "S_School", type: "int", nullable: false, defaultValue: 0, comment: "学校性质Id"); migrationBuilder.CreateTable( name: "S_SchoolAssocGrade", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), SchoolId = table.Column(type: "int", nullable: false, comment: "学校Id"), GradeId = table.Column(type: "int", nullable: false, comment: "年级Id"), 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_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(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), CreateDate = table.Column(type: "datetime", nullable: true, comment: "创建时间"), Creator = table.Column(type: "int)", nullable: false, comment: "创建人"), GradeId = table.Column(type: "int", nullable: false, comment: "年级Id"), Modifier = table.Column(type: "int)", nullable: false, comment: "修改人"), ModifyDate = table.Column(type: "datetime", nullable: true, comment: "修改时间"), SchoolNatureId = table.Column(type: "int", nullable: false, comment: "学校性质Id") }, constraints: table => { table.PrimaryKey("PK_S_SchoolNatureAssocGrade", x => x.Id); }); } } }