<?php

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

class CreateUserDutyChecksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * 用户打卡记录表
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_duty_checks', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('user_id')->index()->comment('外键用户');
            $table->timestamp('checked_at')->index()->comment('打卡时间')->default(null);
            $table->bigInteger('verify_user_id')->nullable()->comment('外键用户(确认人)');
            $table->enum('type',['无','登出','登入'])->default('无')->comment('打卡类型');
            $table->enum('source',['正常','补入'])->default('正常')->comment('来源');
        });
    }

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