<?php

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

class AddFieldToCameraList05191503 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('camera_list', function (Blueprint $table) {
            $table->string('index_code')->nullable()->after('camera_type')->comment('海康摄像头index_code');
            $table->tinyInteger('camera_source')->default(1)->after('camera_type')->comment('摄像头来源 1:视频录像机 2: 视频服务器');
        });
    }

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