<?php

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

class ChangeLaborReportsTables extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('labor_reports', function (Blueprint $table) {
            $table->dropColumn('user_workgroup_id');
        });
        Schema::table('labor_reports', function (Blueprint $table) {
            $table->bigInteger('user_workgroup_id')->nullable()->index()->comment('外键工作组');
            $table->bigInteger('relax_time')->nullable()->comment('晚饭时长');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('labor_reports', function (Blueprint $table) {
            $table->dropColumn('user_workgroup_id');
            $table->dropColumn('relax_time');
        });
    }
}
