using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace YD_WeChatApplet.Api.Migrations { public partial class _20250420v5 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( name: "GoalDuration", table: "WCA_PersonalGoal", type: "int", nullable: false, defaultValue: 0, comment: "目标时长", oldClrType: typeof(int), oldType: "int", oldNullable: true, oldComment: "目标时长"); migrationBuilder.AlterColumn( name: "GoalAmount", table: "WCA_PersonalGoal", type: "int", nullable: false, defaultValue: 0, comment: "目标数量", oldClrType: typeof(int), oldType: "int", oldNullable: true, oldComment: "目标数量"); migrationBuilder.CreateTable( name: "WCA_PersonalGoalResult", columns: table => new { Id = table.Column(type: "int", nullable: false, comment: "Id") .Annotation("SqlServer:Identity", "1, 1"), PersonalGoalName = table.Column(type: "nvarchar(200)", nullable: false, comment: "名称"), UserId = table.Column(type: "int", nullable: false, comment: "用户Id"), HeadImageUrl = table.Column(type: "nvarchar(500)", nullable: true, comment: "头像"), WorkModeType = table.Column(type: "int", nullable: false, comment: "作业类型"), WorkModeTypeName = table.Column(type: "nvarchar(200)", nullable: false, comment: "模式类型名称"), Duration = table.Column(type: "int", nullable: false, comment: "作业时长"), Amount = table.Column(type: "int", nullable: false, comment: "作业数量"), CreateTime = table.Column(type: "datetime", nullable: false, comment: "创建时间"), PersonalGoalId = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_WCA_PersonalGoalResult", x => x.Id); }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "WCA_PersonalGoalResult"); migrationBuilder.AlterColumn( name: "GoalDuration", table: "WCA_PersonalGoal", type: "int", nullable: true, comment: "目标时长", oldClrType: typeof(int), oldType: "int", oldComment: "目标时长"); migrationBuilder.AlterColumn( name: "GoalAmount", table: "WCA_PersonalGoal", type: "int", nullable: true, comment: "目标数量", oldClrType: typeof(int), oldType: "int", oldComment: "目标数量"); } } }