<?php

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

class AddStatusToAppointmentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('appointments', function (Blueprint $table) {
            // Añadir campo status con valores predefinidos
            // 0 = Pendiente (por defecto)
            // 1 = Confirmada
            // 2 = Finalizada
            // 3 = Cancelada
            // 4 = No asistió
            $table->integer('status')->default(0)->comment('0=Pendiente, 1=Confirmada, 2=Finalizada, 3=Cancelada, 4=No asistió');
        });
    }

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