<?php
// Fix cms_services table schema
require_once __DIR__ . '/app/core/Database.php';

try {
    $pdo = Database::connection();
    
    // Check if active column exists
    $checkCol = $pdo->query("SHOW COLUMNS FROM cms_services LIKE 'active'");
    
    if ($checkCol->rowCount() == 0) {
        // Add the active column
        $pdo->exec("ALTER TABLE cms_services ADD COLUMN active BOOLEAN DEFAULT TRUE AFTER icon");
        echo "✓ Added 'active' column to cms_services table<br>";
    } else {
        echo "✓ cms_services table already has 'active' column<br>";
    }
    
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}
?>
