<?php
declare(strict_types=1);

return [
    'up' => "
        CREATE TABLE IF NOT EXISTS `honorary_members` (
            `id`                  BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
            `member_id`           BIGINT UNSIGNED NOT NULL,
            `granted_by_decision` VARCHAR(200) NULL,
            `reason`              TEXT NOT NULL,
            `start_date`          DATE NOT NULL,
            `end_date`            DATE NOT NULL,
            `is_renewable`        TINYINT(1) NOT NULL DEFAULT 1,
            `renewal_count`       INT UNSIGNED NOT NULL DEFAULT 0,
            `last_renewed_at`     TIMESTAMP NULL DEFAULT NULL,
            `status`              VARCHAR(50) NOT NULL DEFAULT 'active',
            `notes`               TEXT NULL,
            `is_archived`         TINYINT(1) NOT NULL DEFAULT 0,
            `archived_at`         TIMESTAMP NULL DEFAULT NULL,
            `archived_by`         BIGINT UNSIGNED NULL,
            `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,
            INDEX `idx_honorary_member` (`member_id`),
            INDEX `idx_honorary_status` (`status`),
            INDEX `idx_honorary_end_date` (`end_date`),
            CONSTRAINT `fk_honorary_member` FOREIGN KEY (`member_id`) REFERENCES `members`(`id`)
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
    ",
    'down' => "DROP TABLE IF EXISTS `honorary_members`",
];