<?php
$mysqli = new mysqli("127.0.0.1", "root", "", "siakad");
if ($mysqli->connect_error) {
    die("Connection failed: " . $mysqli->connect_error);
}
$res = $mysqli->query("ALTER TABLE mata_kuliah ADD COLUMN semester INT(11) NULL DEFAULT NULL");
if ($res) {
    echo "Success adding semester column\n";
    
    // update migration table to skip this migration
    $mysqli->query("INSERT INTO migrations (version, class, `group`, namespace, time, batch) VALUES ('2026-06-24-063056', 'App\\\Database\\\Migrations\\\AddSemesterToMataKuliah', 'default', 'App', UNIX_TIMESTAMP(), 5)");
} else {
    echo "Error: " . $mysqli->error;
}
