<?php
declare(strict_types=1);

return [
    'up' => "
        CREATE TABLE IF NOT EXISTS `sms_templates` (
            `id`                   BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
            `template_code`        VARCHAR(50) NOT NULL,
            `name_ar`              VARCHAR(200) NOT NULL,
            `name_en`              VARCHAR(200) NULL,
            `message_template_ar`  TEXT NOT NULL,
            `message_template_en`  TEXT NULL,
            `variables_json`       JSON NULL,
            `trigger_event`        VARCHAR(100) NULL,
            `is_active`            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,
            `created_by`           BIGINT UNSIGNED NULL,
            `updated_by`           BIGINT UNSIGNED NULL,
            UNIQUE KEY `uq_sms_templates_code` (`template_code`),
            INDEX `idx_sms_templates_trigger` (`trigger_event`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
    ",
    'down' => "DROP TABLE IF EXISTS `sms_templates`",
];