<?php

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

class CreateUsersLabsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if(!Schema::hasTable('users_labs')) {
            Schema::create('users_labs', function (Blueprint $table) {
                $table->bigInteger('id', true);
                $table->bigInteger('lab_id')->nullable();
                $table->bigInteger('user_id')->nullable();
                $table->timestamps();
                $table->softDeletes();
                $table->string('admin', 45)->nullable();
            });
        }
    }

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