34109-vm/db/migrations/009_create_teams_table.php
2025-09-19 12:49:02 +00:00

21 lines
601 B
PHP

<?php
require_once __DIR__ . '/../../db/config.php';
function migrate_009_create_teams_table() {
$pdo = db();
try {
$pdo->exec('
CREATE TABLE IF NOT EXISTS teams (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL UNIQUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
');
echo "Migration 009 successful: Created teams table." . PHP_EOL;
} catch (PDOException $e) {
echo "Migration 009 failed: " . $e->getMessage() . PHP_EOL;
}
}
migrate_009_create_teams_table();