<?php
declare(strict_types=1);

return [
    'up' => "CREATE TABLE IF NOT EXISTS `coach_availability` (
    `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    `coach_id` BIGINT UNSIGNED NOT NULL,
    `day_of_week` TINYINT UNSIGNED NOT NULL COMMENT '0=Sunday, 6=Saturday',
    `start_time` TIME NOT NULL,
    `end_time` TIME NOT NULL,
    `is_available` TINYINT(1) NOT NULL DEFAULT 1,
    `effective_from` DATE NULL,
    `effective_to` DATE NULL,
    `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    INDEX `idx_ca_coach_day` (`coach_id`, `day_of_week`),
    CONSTRAINT `fk_ca_coach` FOREIGN KEY (`coach_id`) REFERENCES `coaches`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
    'down' => "DROP TABLE IF EXISTS `coach_availability`",
];
