YD_WeChatApplet.Api/WeChatApplet/Migrations/20241005152414_init005.cs

75 lines
2.2 KiB
C#
Raw Normal View History

2025-06-06 14:57:20 +08:00
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<DateTime>(
name: "CreateDate",
table: "User",
type: "datetime",
nullable: true,
comment: "创建时间");
migrationBuilder.AddColumn<int>(
name: "Creator",
table: "User",
type: "int",
nullable: false,
defaultValue: 0, // 确保你的业务逻辑需要为非空字段设置默认值
comment: "创建人");
migrationBuilder.AddColumn<int>(
name: "Modifier",
table: "User",
type: "int",
nullable: false,
defaultValue: 0, // 确保业务逻辑允许默认值
comment: "修改人");
migrationBuilder.AddColumn<DateTime>(
name: "ModifyDate",
table: "User",
type: "datetime",
nullable: true,
comment: "修改时间");
migrationBuilder.AddColumn<string>(
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");
}
}
}