using Microsoft.EntityFrameworkCore.Migrations; using System; #nullable disable namespace VOL.Core.Migrations { public partial class init002 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "SchoolNatureId", table: "Sys_User"); migrationBuilder.AddColumn( name: "SchooCode", table: "Sys_User", type: "nvarchar(20)", maxLength: 20, nullable: true); migrationBuilder.AlterColumn( name: "UserName", table: "Sys_Log", type: "text", maxLength: 30000, nullable: true, oldClrType: typeof(string), oldType: "varchar(30000)", oldMaxLength: 30000, oldNullable: true); migrationBuilder.AlterColumn( name: "Url", table: "Sys_Log", type: "text", maxLength: 30000, nullable: true, oldClrType: typeof(string), oldType: "varchar(30000)", oldMaxLength: 30000, oldNullable: true); migrationBuilder.AlterColumn( name: "ResponseParameter", table: "Sys_Log", type: "text", maxLength: 10000, nullable: true, oldClrType: typeof(string), oldType: "nvarchar(10000)", oldMaxLength: 10000, oldNullable: true); migrationBuilder.AlterColumn( name: "RequestParameter", table: "Sys_Log", type: "text", maxLength: 10000, nullable: true, oldClrType: typeof(string), oldType: "nvarchar(10000)", oldMaxLength: 10000, oldNullable: true); migrationBuilder.AlterColumn( name: "ExceptionInfo", table: "Sys_Log", type: "text", maxLength: 10000, nullable: true, oldClrType: typeof(string), oldType: "nvarchar(10000)", oldMaxLength: 10000, oldNullable: true); migrationBuilder.AlterColumn( name: "BrowserType", table: "Sys_Log", type: "varchar(200)", maxLength: 200, nullable: true, oldClrType: typeof(string), oldType: "nvarchar(200)", oldMaxLength: 200, oldNullable: true); migrationBuilder.CreateTable( name: "S_School", 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: "学校编号"), SchoolName = table.Column(type: "nvarchar(100)", nullable: true, comment: "学校名称"), DistrictCode = table.Column(type: "nvarchar(20)", nullable: true, comment: "学校名称"), Remarks = table.Column(type: "text", 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_S_School", x => x.Id); }); // 下面是额外的描述信息 } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "S_School"); migrationBuilder.DropColumn( name: "SchooCode", table: "Sys_User"); migrationBuilder.AddColumn( name: "SchoolNatureId", table: "Sys_User", type: "int", nullable: false, defaultValue: 0, comment: "学校类别Id"); migrationBuilder.AlterColumn( name: "UserName", table: "Sys_Log", type: "varchar(30000)", maxLength: 30000, nullable: true, oldClrType: typeof(string), oldType: "text", oldMaxLength: 30000, oldNullable: true); migrationBuilder.AlterColumn( name: "Url", table: "Sys_Log", type: "varchar(30000)", maxLength: 30000, nullable: true, oldClrType: typeof(string), oldType: "text", oldMaxLength: 30000, oldNullable: true); migrationBuilder.AlterColumn( name: "ResponseParameter", table: "Sys_Log", type: "nvarchar(10000)", maxLength: 10000, nullable: true, oldClrType: typeof(string), oldType: "text", oldMaxLength: 10000, oldNullable: true); migrationBuilder.AlterColumn( name: "RequestParameter", table: "Sys_Log", type: "nvarchar(10000)", maxLength: 10000, nullable: true, oldClrType: typeof(string), oldType: "text", oldMaxLength: 10000, oldNullable: true); migrationBuilder.AlterColumn( name: "ExceptionInfo", table: "Sys_Log", type: "nvarchar(10000)", maxLength: 10000, nullable: true, oldClrType: typeof(string), oldType: "text", oldMaxLength: 10000, oldNullable: true); migrationBuilder.AlterColumn( name: "BrowserType", table: "Sys_Log", type: "nvarchar(200)", maxLength: 200, nullable: true, oldClrType: typeof(string), oldType: "varchar(200)", oldMaxLength: 200, oldNullable: true); } } }