<?php
require_once __DIR__ . '/config/db.php';
try {
    $pdo->exec('ALTER TABLE riwayat_diagnosa ADD COLUMN total_cf_rata FLOAT NOT NULL DEFAULT 0 AFTER total_cf');
    echo "Column added successfully";
} catch (PDOException $e) {
    if (strpos($e->getMessage(), 'Duplicate column name') !== false) {
        echo "Column already exists";
    } else {
        echo "Error: " . $e->getMessage();
    }
}
