<?php
declare(strict_types=1);

return [
    'up' => "CREATE TABLE IF NOT EXISTS `mirror_box_trainees` (
    `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    `box_id` BIGINT UNSIGNED NOT NULL,
    `player_id` BIGINT UNSIGNED NULL,
    `trainee_name` VARCHAR(300) NULL COMMENT 'Manual name if no player entity',
    `assigned_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `assigned_by` BIGINT UNSIGNED NULL,
    INDEX `idx_mbt_box` (`box_id`),
    INDEX `idx_mbt_player` (`player_id`),
    CONSTRAINT `fk_mbt_box` FOREIGN KEY (`box_id`) REFERENCES `mirror_boxes`(`id`) ON DELETE CASCADE,
    CONSTRAINT `fk_mbt_player` FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
    'down' => "DROP TABLE IF EXISTS `mirror_box_trainees`",
];
