<?php

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

class AddColorToClcDoctors extends Migration
{
    public function up()
    {
        Schema::table('clc_doctors', function (Blueprint $table) {
            if (!Schema::hasColumn('clc_doctors', 'color')) {
                $table->string('color', 9)->nullable()->after('status');
            }
        });
    }

    public function down()
    {
        Schema::table('clc_doctors', function (Blueprint $table) {
            if (Schema::hasColumn('clc_doctors', 'color')) {
                $table->dropColumn('color');
            }
        });
    }
}
