<?php
declare(strict_types=1);

return [
    'up' => "CREATE TABLE IF NOT EXISTS `mirror_boxes` (
    `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    `grid_id` BIGINT UNSIGNED NOT NULL,
    `row_index` INT UNSIGNED NOT NULL,
    `col_index` INT UNSIGNED NOT NULL,
    `label` VARCHAR(100) NULL,
    `coach_id` BIGINT UNSIGNED NULL,
    `coach_name` VARCHAR(300) NULL COMMENT 'Manual name if no coach entity',
    `academy_id` BIGINT UNSIGNED NULL,
    `max_trainees` INT UNSIGNED NOT NULL DEFAULT 5,
    `age_group` VARCHAR(50) NULL COMMENT 'e.g. 4-6, 7-9, 10-12',
    `gender` VARCHAR(10) NULL COMMENT 'male, female, mixed',
    `is_active` TINYINT(1) NOT NULL DEFAULT 1,
    `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    INDEX `idx_mb_grid` (`grid_id`),
    UNIQUE KEY `uq_mb_position` (`grid_id`, `row_index`, `col_index`),
    CONSTRAINT `fk_mb_grid` FOREIGN KEY (`grid_id`) REFERENCES `mirror_grids`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
    'down' => "DROP TABLE IF EXISTS `mirror_boxes`",
];
