<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        // 修改枚举列的值
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE ufutx_health_logs MODIFY desc_key ENUM('Weight.1002','Weight.1003','Weight.1004','Weight.1005','Weight.1006','Bodyfat.1002','Bodyfat.1003','Bodyfat.1004','Bodyfat.1005','BMI.1002','BMI.1003','BMI.1004','BMI.1005','Bone.1002','Bone.1003','Bone.1004','HeartIndex.1002','HeartIndex.1003','HeartIndex.1004','HeartRate.1002','HeartRate.1003','HeartRate.1004','HeartRate.1005','HeartRate.1006','Muscle.1002','Muscle.1003','Muscle.1004','Sinew.1002','Sinew.1003','Sinew.1004','Protein.1002','Protein.1003','Protein.1004','Subfat.1002','Subfat.1003','Subfat.1004','Visfat.1002','Visfat.1003','Visfat.1004','Water.1002','Water.1003','Water.1004','Score.1002','Score.1003','Score.1004','Score.1005','LBM.1002','BodyAge.1002','BodyAge.1003','BMR.1002','BMR.1003','BodyShape.1002','BodyShape.1003','BodyShape.1004','BodyShape.1005','BodyShape.1006','BodyShape.1007','BodyShape.1008','BodyShape.1009','BodyShape.1010')  DEFAULT null");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        // 回滚修改，恢复原始的枚举值
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE ufutx_health_logs MODIFY desc_key ENUM('Weight.1002','Weight.1003','Weight.1004','Weight.1005','Weight.1006','Bodyfat.1002','Bodyfat.1003','Bodyfat.1004','Bodyfat.1005','BMI.1002','BMI.1003','BMI.1004','BMI.1005','Bone.1002','Bone.1003','Bone.1004','HeartIndex.1002','HeartIndex.1003','HeartIndex.1004','HeartRate.1002','HeartRate.1003','HeartRate.1004','HeartRate.1005','HeartRate.1006','Muscle.1002','Muscle.1003','Muscle.1004','Sinew.1002','Sinew.1003','Sinew.1004','Protein.1002','Protein.1003','Protein.1004','Subfat.1002','Subfat.1003','Subfat.1004','Visfat.1002','Visfat.1003','Visfat.1004','Water.1002','Water.1003','Water.1004','Score.1002','Score.1003','Score.1004','Score.1005','LBM.1002','BodyAge.1002','BodyAge.1003','BMR.1002','BMR.1003','BodyShape.1002','BodyShape.1003','BodyShape.1004','BodyShape.1005','BodyShape.1006','BodyShape.1007','BodyShape.1008','BodyShape.1009','BodyShape.1010')  DEFAULT 'Weight.1002'");
    }
};
