<?php
declare(strict_types=1);

return [
    'up' => "CREATE TABLE `sa_disciplines` (
    `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    `code` VARCHAR(30) NOT NULL,
    `name_ar` VARCHAR(200) NOT NULL,
    `name_en` VARCHAR(200) NULL,
    `category` VARCHAR(30) NOT NULL COMMENT 'individual, team, racket, aquatic, combat, leisure',
    `icon` VARCHAR(50) NULL,
    `description_ar` TEXT NULL,
    `config_json` JSON NULL COMMENT 'age_groups, skill_levels, special_requirements',
    `sort_order` INT UNSIGNED NOT NULL DEFAULT 0,
    `is_active` TINYINT(1) NOT NULL DEFAULT 1,
    `is_archived` TINYINT(1) NOT NULL DEFAULT 0,
    `archived_at` TIMESTAMP 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,
    UNIQUE KEY `uq_sa_disc_code` (`code`),
    INDEX `idx_sa_disc_category` (`category`),
    INDEX `idx_sa_disc_active` (`is_active`, `is_archived`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;",
    'down' => "DROP TABLE IF EXISTS sa_disciplines;"
];
