<?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_logs', function (Blueprint $table) {
            $table->id();
            $table->integer('user_id')->unsigned()->comment("用户id")->index();
            $table->string('fat_name', 50)->comment("名称");
            $table->string('fat_state', 50)->comment("状态")->nullable();
            $table->string('fat_data', 20)->comment("分值")->nullable();
            $table->string('unit',10)->comment("单位")->nullable();
            $table->timestamp('tested_at')->comment('测量时间')->index();
            $table->timestamps();
        });
    }

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