64 lines
1.9 KiB
C#
64 lines
1.9 KiB
C#
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<float>(
|
|
name: "Strength",
|
|
table: "Ai_HeartRateData",
|
|
type: "float",
|
|
nullable: false,
|
|
comment: "运动强度",
|
|
oldClrType: typeof(int),
|
|
oldType: "int",
|
|
oldComment: "运动强度");
|
|
|
|
// 添加新的 HeartRate 列
|
|
migrationBuilder.AddColumn<float>(
|
|
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<int>(
|
|
name: "Strength",
|
|
table: "Ai_HeartRateData",
|
|
type: "int",
|
|
nullable: false,
|
|
comment: "运动强度",
|
|
oldClrType: typeof(double),
|
|
oldType: "double",
|
|
oldComment: "运动强度");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "Value",
|
|
table: "Ai_HeartRateData",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0,
|
|
comment: "心率");
|
|
}
|
|
}
|
|
}
|