37338-vm/db/migrations/005_create_bni_groups_table.php
2026-01-10 07:48:27 +00:00

19 lines
554 B
PHP

<?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);
}