<?php

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

class AddSoapPlanMedsJsonToClcAppointments extends Migration
{
    public function up()
    {
        if (!Schema::hasColumn('clc_appointments', 'soap_plan_meds_json')) {
            Schema::table('clc_appointments', function (Blueprint $table) {
                $table->text('soap_plan_meds_json')->nullable()->after('soap_plan');
            });
        }
    }

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