<?php
require_once 'api/db.php';

try {
    $pdo->exec("ALTER TABLE `users` ADD `printing_method` ENUM('Browser', 'LocalService', 'MobilePOS') NOT NULL DEFAULT 'Browser'");
    echo "Database updated successfully: Added printing_method to users table.\n";
} catch (PDOException $e) {
    if (strpos($e->getMessage(), 'Duplicate column name') !== false) {
        echo "Column 'printing_method' already exists.\n";
    } else {
        echo "Error updating database: " . $e->getMessage() . "\n";
    }
}
?>
