<?php

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

class CreateMeasuringMachinesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('measuring_machines', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name')->index()->comment('设备名');
            $table->string('code')->unique()->comment('设备ID');
            $table->enum('status',['在线','离线'])->default('离线')->comment('设备状态');
            $table->timestamps();
        });
    }

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