<?php
declare(strict_types=1);

return [
    'up' => "CREATE TABLE IF NOT EXISTS `pool_lanes` (
    `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    `pool_config_id` BIGINT UNSIGNED NOT NULL,
    `lane_number` INT UNSIGNED NOT NULL,
    `direction` VARCHAR(10) NOT NULL DEFAULT 'lengthwise' COMMENT 'lengthwise, widthwise',
    `width_meters` DECIMAL(4,2) NOT NULL,
    `label_ar` VARCHAR(50) NULL,
    `label_en` VARCHAR(50) NULL,
    `max_swimmers` INT UNSIGNED NOT NULL DEFAULT 8,
    `is_active` TINYINT(1) NOT NULL DEFAULT 1,
    `sort_order` INT UNSIGNED NOT NULL DEFAULT 0,
    `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    INDEX `idx_pl_config` (`pool_config_id`),
    UNIQUE KEY `uq_pl_config_lane` (`pool_config_id`, `direction`, `lane_number`),
    CONSTRAINT `fk_pl_config` FOREIGN KEY (`pool_config_id`) REFERENCES `pool_configurations`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
    'down' => "DROP TABLE IF EXISTS `pool_lanes`",
];
