<?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()
    {
        Schema::create('fat_max_min', function (Blueprint $table) {
            $table->id();
            $table->integer('date')->comment('日期')->index();
            $table->integer('user_id')->comment('用户id')->index();
            $table->string('name')->comment('数值名称');
            $table->string('fat_data')->nullable()->comment('值');
            $table->tinyInteger('type')->default(0)->comment('体脂称类型 0:旧版 1:新版');
            $table->tinyInteger('value_type')->default(0)->comment('值类型 0:最大值 1:最小值');
            $table->string('unit')->nullable()->comment('单位');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('fat_max_min');
    }
};
