<?php
declare(strict_types=1);

return [
    'up' => "
ALTER TABLE waiver_requests
    ADD COLUMN original_spouses_count INT UNSIGNED NOT NULL DEFAULT 0 AFTER original_dependent_count,
    ADD COLUMN original_children_count INT UNSIGNED NOT NULL DEFAULT 0 AFTER original_spouses_count,
    ADD COLUMN original_temporary_count INT UNSIGNED NOT NULL DEFAULT 0 AFTER original_children_count,
    ADD COLUMN new_spouses_count INT UNSIGNED NULL AFTER new_dependent_count,
    ADD COLUMN new_children_count INT UNSIGNED NULL AFTER new_spouses_count,
    ADD COLUMN new_temporary_count INT UNSIGNED NULL AFTER new_children_count,
    ADD COLUMN excess_spouses_count INT UNSIGNED NOT NULL DEFAULT 0 AFTER excess_dependent_count,
    ADD COLUMN excess_children_count INT UNSIGNED NOT NULL DEFAULT 0 AFTER excess_spouses_count,
    ADD COLUMN excess_temporary_count INT UNSIGNED NOT NULL DEFAULT 0 AFTER excess_children_count,
    ADD COLUMN spouse_fee_type ENUM('fixed','percentage') NULL AFTER excess_fee_amount,
    ADD COLUMN spouse_fee_rate DECIMAL(15,2) NULL AFTER spouse_fee_type,
    ADD COLUMN spouse_fee_total DECIMAL(15,2) NOT NULL DEFAULT 0.00 AFTER spouse_fee_rate,
    ADD COLUMN child_fee_type ENUM('fixed','percentage') NULL AFTER spouse_fee_total,
    ADD COLUMN child_fee_rate DECIMAL(15,2) NULL AFTER child_fee_type,
    ADD COLUMN child_fee_total DECIMAL(15,2) NOT NULL DEFAULT 0.00 AFTER child_fee_rate,
    ADD COLUMN temporary_fee_type ENUM('fixed','percentage') NULL AFTER child_fee_total,
    ADD COLUMN temporary_fee_rate DECIMAL(15,2) NULL AFTER temporary_fee_type,
    ADD COLUMN temporary_fee_total DECIMAL(15,2) NOT NULL DEFAULT 0.00 AFTER temporary_fee_rate,
    ADD COLUMN target_debts_cleared TINYINT(1) NOT NULL DEFAULT 0 AFTER debts_cleared;
",
    'down' => "
ALTER TABLE waiver_requests
    DROP COLUMN original_spouses_count,
    DROP COLUMN original_children_count,
    DROP COLUMN original_temporary_count,
    DROP COLUMN new_spouses_count,
    DROP COLUMN new_children_count,
    DROP COLUMN new_temporary_count,
    DROP COLUMN excess_spouses_count,
    DROP COLUMN excess_children_count,
    DROP COLUMN excess_temporary_count,
    DROP COLUMN spouse_fee_type,
    DROP COLUMN spouse_fee_rate,
    DROP COLUMN spouse_fee_total,
    DROP COLUMN child_fee_type,
    DROP COLUMN child_fee_rate,
    DROP COLUMN child_fee_total,
    DROP COLUMN temporary_fee_type,
    DROP COLUMN temporary_fee_rate,
    DROP COLUMN temporary_fee_total,
    DROP COLUMN target_debts_cleared;
",
];
