<?php
try {
    // Create the table using the existing database connection
    $pdo = new PDO('mysql:host=localhost;dbname=inventory_db', 'root', '');
    
    $sql = "CREATE TABLE IF NOT EXISTS accounting_category_group_names (
        id INT AUTO_INCREMENT PRIMARY KEY,
        category_group_code VARCHAR(3) NOT NULL,
        category_group_name VARCHAR(200) NOT NULL,
        description TEXT NULL,
        created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
        updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
        UNIQUE KEY unique_category_group_code (category_group_code)
    )";
    
    $pdo->exec($sql);
    echo "Table created successfully!\n";
    
} catch (PDOException $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
?>
