<?php
declare(strict_types=1);

return [
    'up' => "
        CREATE TABLE IF NOT EXISTS `hr_job_titles` (
            `id`                    BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
            `title_code`            VARCHAR(20) NOT NULL,
            `name_ar`               VARCHAR(200) NOT NULL,
            `name_en`               VARCHAR(200) NULL,
            `description_ar`        TEXT NULL,
            `grade_level`           INT UNSIGNED NULL,
            `min_salary`            DECIMAL(15,2) NULL,
            `max_salary`            DECIMAL(15,2) 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,
            `is_archived`           TINYINT(1) NOT NULL DEFAULT 0,
            `archived_at`           TIMESTAMP NULL DEFAULT NULL,
            `archived_by`           BIGINT UNSIGNED NULL,
            UNIQUE KEY `uq_hr_job_titles_code` (`title_code`),
            INDEX `idx_hr_job_titles_grade` (`grade_level`),
            INDEX `idx_hr_job_titles_active` (`is_active`),
            INDEX `idx_hr_job_titles_archived` (`is_archived`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
    ",
    'down' => "DROP TABLE IF EXISTS `hr_job_titles`",
];
