<?php
require_once dirname(__DIR__) . '/config/database.php';
$db = getDB();

try {
    $db->exec("ALTER TABLE anggota ADD COLUMN is_konsumsi TINYINT(1) DEFAULT 1 AFTER status");
    echo "Column 'is_konsumsi' added successfully.";
} catch (Exception $e) {
    if (strpos($e->getMessage(), 'Duplicate column name') !== false) {
        echo "Column 'is_konsumsi' already exists.";
    } else {
        echo "Error: " . $e->getMessage();
    }
}
?>
