<?php

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

class ChangeAuthoritiesAndUserDutyChecksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('authorities',function (Blueprint $table){
            $table->enum('type',['通用','工作组','货主'])->default('通用')->comment('类别');
            $table->bigInteger('relevance')->nullable()->comment('外键类型关联表');
        });
        Schema::table('user_duty_checks',function (Blueprint $table){
            $table->bigInteger('group_user_id')->nullable()->comment('组长审核');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('authorities',function (Blueprint $table){
            $table->dropColumn('type');
            $table->dropColumn('relevance');
        });
        Schema::table('user_duty_checks',function (Blueprint $table){
            $table->dropColumn('group_user_id');
        });
    }
}
