<?php
declare(strict_types=1);

return [
    'up' => "
CREATE TABLE IF NOT EXISTS group_transfer_requests (
    id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    player_id INT UNSIGNED NOT NULL,
    from_group_id INT UNSIGNED NOT NULL,
    to_group_id INT UNSIGNED NULL COMMENT 'NULL if player just wants to leave',
    reason_ar TEXT NULL,
    status ENUM('pending','approved','rejected','waitlisted') NOT NULL DEFAULT 'pending',
    reviewed_by INT UNSIGNED NULL,
    reviewed_at DATETIME NULL,
    review_notes TEXT NULL,
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    INDEX idx_player (player_id),
    INDEX idx_status (status),
    INDEX idx_from_group (from_group_id),
    INDEX idx_to_group (to_group_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
",
    'down' => "DROP TABLE IF EXISTS group_transfer_requests",
];
