<?php
require_once __DIR__ . '/../../db/config.php';

try {
    $pdo = db();

    $sql = <<<SQL
    ALTER TABLE `calendar_events`
    ADD COLUMN `recurrence` VARCHAR(20) DEFAULT NULL,
    ADD COLUMN `recurrence_end_date` DATE DEFAULT NULL,
    ADD COLUMN `parent_event_id` INT DEFAULT NULL;
SQL;

    $pdo->exec($sql);

    echo "Migration 006 executed successfully: Added recurrence columns to calendar_events table.\n";

} catch (Exception $e) {
    die("Error executing migration 006: " . $e->getMessage() . "\n");
}