<?php
define('SECURE_ACCESS', true);
require_once __DIR__ . '/../includes/config.php';
require_once __DIR__ . '/../includes/db.php';

try {
    $db = getDBConnection(true);
    $db->exec("
        CREATE TABLE IF NOT EXISTS event_speakers (
            id SERIAL PRIMARY KEY,
            event_id INTEGER REFERENCES events(id) ON DELETE CASCADE,
            speaker_profile_id INTEGER REFERENCES speaker_profiles(id) ON DELETE CASCADE,
            UNIQUE (event_id, speaker_profile_id)
        )
    ");
    echo "event_speakers table successfully created!\n";
} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
