using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace VOL.Core.Migrations { public partial class init093 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { // 删除原来的 Value 列 migrationBuilder.DropColumn( name: "Value", table: "Ai_HeartRateData"); // 修改 Strength 列的数据类型 migrationBuilder.AlterColumn( name: "Strength", table: "Ai_HeartRateData", type: "float", nullable: false, comment: "运动强度", oldClrType: typeof(int), oldType: "int", oldComment: "运动强度"); // 添加新的 HeartRate 列 migrationBuilder.AddColumn( name: "heartrate", table: "Ai_HeartRateData", type: "float", nullable: false, defaultValue: 0.0, comment: "心率"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "HeartRate", table: "Ai_HeartRateData"); migrationBuilder.AlterColumn( name: "Strength", table: "Ai_HeartRateData", type: "int", nullable: false, comment: "运动强度", oldClrType: typeof(double), oldType: "double", oldComment: "运动强度"); migrationBuilder.AddColumn( name: "Value", table: "Ai_HeartRateData", type: "int", nullable: false, defaultValue: 0, comment: "心率"); } } }