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

try {
    $db = db();
    // Check if column already exists
    $columns = $db->query("SHOW COLUMNS FROM game_resources LIKE 'show_in_header'")->fetchAll();
    if (empty($columns)) {
        $db->exec("ALTER TABLE game_resources ADD COLUMN show_in_header TINYINT(1) DEFAULT 0");
        echo "Column 'show_in_header' added successfully to 'game_resources'.\n";
    } else {
        echo "Column 'show_in_header' already exists.\n";
    }
} catch (PDOException $e) {
    echo "Error: " . $e->getMessage() . "\n";
}

