using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace YD_WeChatApplet.Api.Migrations { public partial class init005 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "CreateDate", table: "User", type: "datetime", nullable: true, comment: "创建时间"); migrationBuilder.AddColumn( name: "Creator", table: "User", type: "int", nullable: false, defaultValue: 0, // 确保你的业务逻辑需要为非空字段设置默认值 comment: "创建人"); migrationBuilder.AddColumn( name: "Modifier", table: "User", type: "int", nullable: false, defaultValue: 0, // 确保业务逻辑允许默认值 comment: "修改人"); migrationBuilder.AddColumn( name: "ModifyDate", table: "User", type: "datetime", nullable: true, comment: "修改时间"); migrationBuilder.AddColumn( name: "Remarks", table: "User", type: "text", nullable: true, // 这里可以设置为 true 以允许空值 comment: "备注"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "CreateDate", table: "User"); migrationBuilder.DropColumn( name: "Creator", table: "User"); migrationBuilder.DropColumn( name: "Modifier", table: "User"); migrationBuilder.DropColumn( name: "ModifyDate", table: "User"); migrationBuilder.DropColumn( name: "Remarks", table: "User"); } } }