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

try {
    $pdo = db();
    $sql = "CREATE TABLE IF NOT EXISTS `roles` (
        `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
        `name` VARCHAR(255) NOT NULL,
        PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";
    $pdo->exec($sql);
    echo "Table 'roles' created successfully." . PHP_EOL;
} catch (PDOException $e) {
    echo "Error creating table 'roles': " . $e->getMessage() . PHP_EOL;
    exit(1);
}
