<?php
declare(strict_types=1);

return [
    'up' => "
        CREATE TABLE IF NOT EXISTS `system_config` (
            `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
            `config_key` VARCHAR(255) NOT NULL,
            `config_value` TEXT NULL,
            `config_type` ENUM('string','integer','float','boolean','json') NOT NULL DEFAULT 'string',
            `group_name` VARCHAR(100) NOT NULL DEFAULT 'general',
            `description_ar` VARCHAR(500) NULL,
            `description_en` VARCHAR(500) NULL,
            `is_editable` TINYINT(1) NOT NULL DEFAULT 1,
            `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
            `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
            UNIQUE KEY `uq_system_config_key` (`config_key`),
            INDEX `idx_system_config_group` (`group_name`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
    ",
    'down' => "DROP TABLE IF EXISTS `system_config`",
];