<?php
declare(strict_types=1);

return [
    'up' => "CREATE TABLE `installment_cheques` (
    `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    `installment_plan_id` BIGINT UNSIGNED NOT NULL,
    `cheque_number` VARCHAR(50) NOT NULL,
    `bank_name` VARCHAR(200) NOT NULL,
    `cheque_date` DATE NOT NULL,
    `cheque_amount` DECIMAL(15,2) NOT NULL,
    `scan_path` VARCHAR(500) NOT NULL,
    `scan_original_name` VARCHAR(300) NULL,
    `uploaded_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `uploaded_by` BIGINT UNSIGNED NULL,
    `notes` VARCHAR(500) NULL,
    `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    INDEX `idx_ic_plan` (`installment_plan_id`),
    INDEX `idx_ic_cheque_number` (`cheque_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;",

    'down' => "DROP TABLE IF EXISTS `installment_cheques`;",
];
