<?php
// update_bio_schema.php
ini_set('display_errors', 1);
error_reporting(E_ALL);

require_once __DIR__ . '/../src/Utils/Env.php';
require_once __DIR__ . '/../src/Config/Database.php';

use App\Utils\Env;
use App\Config\Database;

try {
    Env::load(__DIR__ . '/../../.env');
    $db = Database::getInstance()->getConnection();

    echo "Adding bio column to users...\n";
    try {
        $db->exec("ALTER TABLE users ADD COLUMN bio TEXT NULL AFTER display_name");
        echo "Bio column added.\n";
    } catch (PDOException $e) {
        echo "Bio column might already exist.\n";
    }

    echo "Schema update complete.\n";

} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
