<?php
$db = new mysqli('localhost', 'root', '', 'siakad');
if ($db->connect_error) {
    die("Connection failed: " . $db->connect_error);
}

$queries = [
    "ALTER TABLE `mahasiswa` ADD COLUMN `tempat_lahir` VARCHAR(100) NULL",
    "ALTER TABLE `mahasiswa` ADD COLUMN `tanggal_lahir` DATE NULL",
    "ALTER TABLE `mahasiswa` ADD COLUMN `kewarganegaraan` VARCHAR(50) NOT NULL DEFAULT 'WNI'",
    "ALTER TABLE `mahasiswa` ADD COLUMN `nik` VARCHAR(20) NULL",
    "ALTER TABLE `mahasiswa` ADD COLUMN `status_mahasiswa` ENUM('Aktif', 'Cuti', 'Lulus', 'Keluar', 'Drop Out') NOT NULL DEFAULT 'Aktif'"
];

foreach ($queries as $query) {
    if ($db->query($query) === TRUE) {
        echo "Successfully ran: $query\n";
    } else {
        echo "Error running: $query - " . $db->error . "\n";
    }
}
