<?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('band_sleeps', function (Blueprint $table) {
            $table->id();
            $table->integer('user_id')->unsigned()->comment("用户id");
            $table->integer('band_id')->unsigned()->comment("手环id");
            $table->timestamp('date')->nullable()->comment("时间");
            $table->integer('value')->comment("数值");
            $table->integer('unit')->unsigned()->comment("采集时间单位");
            $table->integer('origin_value')->unsigned()->comment("原始数据");
            $table->timestamps();
        });
    }

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