<?php
$mysqli = new mysqli("127.0.0.1", "root", "", "siakad");

$res = $mysqli->query("SHOW COLUMNS FROM dosen LIKE 'jenis_dosen'");
if ($res->num_rows == 0) {
    $mysqli->query("ALTER TABLE dosen ADD COLUMN jenis_dosen ENUM('Internal', 'Eksternal') DEFAULT 'Internal' AFTER status_aktif");
    echo "Column jenis_dosen added.\n";
} else {
    echo "Column jenis_dosen already exists.\n";
}
?>
