<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::dropIfExists('featured_products');

        // Clean up rows the plugin left behind on existing installs. Deploys run
        // `migrate --force` without re-seeding, so AdminMenuTableSeeder will not
        // remove these on its own.
        DB::table('settings')->where('key', 'FEATURED_PRODUCTS')->delete();
        DB::table('admin_menu')->where('constant', 'FEATURED_PRODUCTS')->delete();
    }

    public function down(): void
    {
        // Intentionally not implemented — FeaturedProducts plugin has been permanently removed.
    }
};
