<?php
declare(strict_types=1);

return [
    'up' => "
        CREATE TABLE IF NOT EXISTS `sports_members` (
            `id`                        BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
            `member_id`                 BIGINT UNSIGNED NOT NULL,
            `sport_name`                VARCHAR(200) NOT NULL,
            `federation_name`           VARCHAR(200) NULL,
            `federation_registration`   VARCHAR(100) NULL,
            `registration_date`         DATE NULL,
            `years_of_service`          INT UNSIGNED NOT NULL DEFAULT 0,
            `highest_competitive_level` VARCHAR(200) NULL,
            `is_conversion_eligible`    TINYINT(1) NOT NULL DEFAULT 0,
            `conversion_requested`      TINYINT(1) NOT NULL DEFAULT 0,
            `conversion_date`           DATE NULL,
            `conversion_fee`            DECIMAL(15,2) NULL,
            `conversion_receipt`        VARCHAR(50) NULL,
            `status`                    VARCHAR(50) NOT NULL DEFAULT 'active',
            `notes`                     TEXT NULL,
            `is_archived`               TINYINT(1) NOT NULL DEFAULT 0,
            `archived_at`               TIMESTAMP NULL DEFAULT NULL,
            `archived_by`               BIGINT UNSIGNED NULL,
            `created_at`                TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
            `updated_at`                TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
            `created_by`                BIGINT UNSIGNED NULL,
            `updated_by`                BIGINT UNSIGNED NULL,
            INDEX `idx_sports_member` (`member_id`),
            INDEX `idx_sports_status` (`status`),
            CONSTRAINT `fk_sports_member` FOREIGN KEY (`member_id`) REFERENCES `members`(`id`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
    ",
    'down' => "DROP TABLE IF EXISTS `sports_members`",
];