<?php

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

return new class extends Migration
{
    public function up(): void
    {
        if (!Schema::hasColumn('notification_preferences', 'channel_push')) {
            Schema::table('notification_preferences', function (Blueprint $table) {
                $table->boolean('channel_push')->default(true)->after('channel_sms');
            });
        }
    }

    public function down(): void
    {
        Schema::table('notification_preferences', function (Blueprint $table) {
            $table->dropColumn('channel_push');
        });
    }
};
