<?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('categories', function (Blueprint $table) {
            $table->index('front_view');
            $table->index('parent_id');
        });

        Schema::table('banners', function (Blueprint $table) {
            $table->index('category_id');
            $table->index('status');
        });

        Schema::table('brands', function (Blueprint $table) {
            $table->index('status');
        });

        Schema::table('social_media', function (Blueprint $table) {
            $table->index('status');
        });
    }

    public function down(): void
    {
        Schema::table('categories', function (Blueprint $table) {
            $table->dropIndex(['front_view']);
            $table->dropIndex(['parent_id']);
        });
        Schema::table('banners', function (Blueprint $table) {
            $table->dropIndex(['category_id']);
            $table->dropIndex(['status']);
        });
        Schema::table('brands', function (Blueprint $table) {
            $table->dropIndex(['status']);
        });
        Schema::table('social_media', function (Blueprint $table) {
            $table->dropIndex(['status']);
        });
    }
};
