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

try {
    $pdo = db();
    $sql = "CREATE TABLE IF NOT EXISTS `bni_groups` (
        `id` INT AUTO_INCREMENT PRIMARY KEY,
        `name` VARCHAR(255) NOT NULL,
        `city` VARCHAR(255),
        `active` BOOLEAN NOT NULL DEFAULT 1,
        `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
    );";
    $pdo->exec($sql);
    echo "Table 'bni_groups' created successfully." . PHP_EOL;
} catch (PDOException $e) {
    echo "Error creating table 'bni_groups': " . $e->getMessage() . PHP_EOL;
    exit(1);
}
