<?php
declare(strict_types=1);

return [
    'up' => "CREATE TABLE `sa_coach_disciplines` (
    `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    `coach_id` BIGINT UNSIGNED NOT NULL,
    `discipline_id` BIGINT UNSIGNED NOT NULL,
    `specialization_level` VARCHAR(20) NOT NULL DEFAULT 'primary' COMMENT 'primary, secondary',
    `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    UNIQUE KEY `uq_sa_cd` (`coach_id`, `discipline_id`),
    CONSTRAINT `fk_sa_cd_coach` FOREIGN KEY (`coach_id`) REFERENCES `sa_coaches`(`id`) ON DELETE CASCADE,
    CONSTRAINT `fk_sa_cd_disc` FOREIGN KEY (`discipline_id`) REFERENCES `sa_disciplines`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;",
    'down' => "DROP TABLE IF EXISTS `sa_coach_disciplines`;"
];
