<?php
declare(strict_types=1);

return [
    'up' => "CREATE TABLE IF NOT EXISTS `player_progressions` (
    `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    `player_id` BIGINT UNSIGNED NOT NULL,
    `discipline_id` BIGINT UNSIGNED NOT NULL,
    `from_level_id` BIGINT UNSIGNED NULL,
    `to_level_id` BIGINT UNSIGNED NOT NULL,
    `progression_type` VARCHAR(30) NOT NULL COMMENT 'promotion, demotion, lateral',
    `assessment_score` DECIMAL(5,2) NULL,
    `assessed_by` BIGINT UNSIGNED NULL COMMENT 'Coach who assessed',
    `assessment_notes` TEXT NULL,
    `effective_date` DATE NOT NULL,
    `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    INDEX `idx_pp_player` (`player_id`),
    INDEX `idx_pp_discipline` (`discipline_id`),
    CONSTRAINT `fk_pp_player` FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE,
    CONSTRAINT `fk_pp_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 `player_progressions`",
];
