<?php
require_once 'db/config.php';
$pdo = db();

// Tables pour le système de guildes
$pdo->exec("CREATE TABLE IF NOT EXISTS guilds (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)");

$pdo->exec("CREATE TABLE IF NOT EXISTS guild_creation_requirements (
    id INT AUTO_INCREMENT PRIMARY KEY,
    resource_id INT NOT NULL,
    quantity INT NOT NULL,
    FOREIGN KEY (resource_id) REFERENCES game_resources(id)
)");

$pdo->exec("CREATE TABLE IF NOT EXISTS guild_restrictions (
    id INT AUTO_INCREMENT PRIMARY KEY,
    restriction_key VARCHAR(255) NOT NULL,
    restriction_value TEXT
)");
