<?php
declare(strict_types=1);

return [
    'up' => "CREATE TABLE IF NOT EXISTS `coach_disciplines` (
    `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    `coach_id` BIGINT UNSIGNED NOT NULL,
    `discipline_id` BIGINT UNSIGNED NOT NULL,
    `specialization_level` VARCHAR(30) NOT NULL DEFAULT 'general' COMMENT 'general, specialist, head_coach',
    `is_primary` TINYINT(1) NOT NULL DEFAULT 0,
    `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    UNIQUE KEY `uq_cd_coach_discipline` (`coach_id`, `discipline_id`),
    CONSTRAINT `fk_cd_coach` FOREIGN KEY (`coach_id`) REFERENCES `coaches`(`id`) ON DELETE CASCADE,
    CONSTRAINT `fk_cd_discipline` FOREIGN KEY (`discipline_id`) REFERENCES `sport_disciplines`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
    'down' => "DROP TABLE IF EXISTS `coach_disciplines`",
];
