<?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
    {
        Schema::table('siswas', function (Blueprint $table) {
            $table->index('id_kelas', 'siswas_id_kelas_index');
        });
        Schema::table('mengajars', function (Blueprint $table) {
            $table->index('id_kelas', 'mengajars_id_kelas_index');
            $table->index('id_mapel', 'mengajars_id_mapel_index');
            $table->index('id_guru', 'mengajars_id_guru_index');
        });
    }

    public function down(): void
    {
        Schema::table('siswas', function (Blueprint $table) {
            $table->dropIndex('siswas_id_kelas_index');
        });
        Schema::table('mengajars', function (Blueprint $table) {
            $table->dropIndex('mengajars_id_kelas_index');
            $table->dropIndex('mengajars_id_mapel_index');
            $table->dropIndex('mengajars_id_guru_index');
        });
    }
};