using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace YD_WeChatApplet.Api.Migrations { public partial class _20250420v1 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( name: "WorkTypeName", table: "WCA_GroupTask", type: "nvarchar(200)", nullable: true, comment: "作业类型名称", oldClrType: typeof(string), oldType: "nvarchar(200)", oldComment: "作业类型名称"); migrationBuilder.CreateTable( name: "WCA_PersonalGoal", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), UserId = table.Column(type: "int", nullable: false, comment: "用户Id"), GoalType = table.Column(type: "int", nullable: false, comment: "目标类型"), GoalTypeName = table.Column(type: "nvarchar(200)", nullable: false, comment: "目标类型名称"), GoalDuration = table.Column(type: "int", nullable: true, comment: "目标时长"), GoalAmount = table.Column(type: "int", nullable: true, comment: "目标数量"), GoalDate = table.Column(type: "datetime", nullable: false, comment: "目标日期") }, constraints: table => { table.PrimaryKey("PK_WCA_PersonalGoal", x => x.Id); }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "WCA_PersonalGoal"); migrationBuilder.AlterColumn( name: "WorkTypeName", table: "WCA_GroupTask", type: "nvarchar(200)", nullable: false, defaultValue: "", comment: "作业类型名称", oldClrType: typeof(string), oldType: "nvarchar(200)", oldNullable: true, oldComment: "作业类型名称"); } } }