<?php
declare(strict_types=1);

return [
    'up' => "
CREATE TABLE IF NOT EXISTS coach_day_off_requests (
    id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    coach_id INT UNSIGNED NOT NULL,
    request_date DATE NOT NULL,
    reason_ar TEXT NULL,
    status VARCHAR(20) NOT NULL DEFAULT 'pending',
    replacement_coach_id INT UNSIGNED NULL,
    replacement_volunteered_at DATETIME NULL,
    affected_sessions_json JSON NULL,
    reviewed_by INT UNSIGNED NULL,
    reviewed_at DATETIME NULL,
    admin_notes TEXT NULL,
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME NULL,
    KEY idx_coach_date (coach_id, request_date),
    KEY idx_status (status),
    KEY idx_replacement (replacement_coach_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
    'down' => "DROP TABLE IF EXISTS coach_day_off_requests",
];
