<?php
require_once __DIR__ . '/../config/database.php';

try {
    echo "Checking 'rosters' table for 'checklist_json' column...\n";
    
    // Check if column exists
    $stmt = $pdo->query("SHOW COLUMNS FROM rosters LIKE 'checklist_json'");
    if ($stmt->rowCount() == 0) {
        echo "Column not found. Adding 'checklist_json'...\n";
        $pdo->exec("ALTER TABLE rosters ADD COLUMN checklist_json TEXT NULL AFTER status");
        echo "Column added successfully.\n";
    } else {
        echo "Column 'checklist_json' already exists.\n";
    }
    
} catch (PDOException $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
?>
