<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('today_issues', function (Blueprint $table) {
            $table->string('notification_type', 50)->nullable()->after('badge')->comment('알림 유형 (sales_order, new_vendor, approval_request, bad_debt, safety_stock, expected_expense, vat_report)');
            $table->index('notification_type');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('today_issues', function (Blueprint $table) {
            $table->dropIndex(['notification_type']);
            $table->dropColumn('notification_type');
        });
    }
};
