<?php
// Script to add indexes for performance optimization
$db = mysqli_connect('localhost', 'root', '', 'simkp_asn');
if (!$db)
    die("Connection failed");

$queries = [
    "ALTER TABLE dokumen ADD INDEX (nip)",
    "ALTER TABLE dokumen ADD INDEX (status_verifikasi)",
    "ALTER TABLE pengajuan ADD INDEX (target_nip)"
];

foreach ($queries as $sql) {
    if (mysqli_query($db, $sql)) {
        echo "Successfully executed: $sql\n";
    } else {
        echo "Failed or already exists: " . mysqli_error($db) . "\n";
    }
}

mysqli_close($db);
