<?php
declare(strict_types=1);

return [
    'up' => "
CREATE TABLE `treasuries` (
    `id`              BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    `code`            VARCHAR(20) NOT NULL UNIQUE,
    `name_ar`         VARCHAR(100) NOT NULL,
    `name_en`         VARCHAR(100) NULL,
    `type`            ENUM('main','sub') NOT NULL,
    `account_code`    VARCHAR(20) NOT NULL,
    `branch_id`       BIGINT UNSIGNED 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,
    INDEX `idx_treasuries_type` (`type`),
    INDEX `idx_treasuries_branch` (`branch_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
",
    'down' => "DROP TABLE IF EXISTS `treasuries`",
];
