<?php

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

class CreateInnerDevicesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('inner_devices', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name', 200)->nullable();
            $table->unsignedInteger('device_id')->comment('设备类型ID')->nullable();
            $table->unsignedInteger('spec_id')->comment('规格型号ID')->nullable();
            $table->tinyInteger('status')->comment('状态1闲置中，2使用中，3故障')->nullable();
            $table->string('number', 200)->nullable()->comment('固定资产编号');
            $table->date('produce_date')->nullable()->comment('出厂日期');
            $table->string('shape', 200)->nullable()->comment('外形尺寸');
            $table->string('buy_origin', 200)->nullable()->comment('采购原值');
            $table->string('manufacturer', 200)->nullable()->comment('生产厂家');
            $table->date('start_date')->nullable()->comment('借用时间');
            $table->date('end_date')->nullable()->comment('借用时间');
            $table->timestamps();
        });
    }

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