<?php
declare(strict_types=1);

return [
    'up' => "
        ALTER TABLE `members`
            ADD COLUMN `special_discount_id` BIGINT UNSIGNED NULL AFTER `membership_value`,
            ADD COLUMN `special_discount_document` VARCHAR(500) NULL AFTER `special_discount_id`,
            ADD COLUMN `discount_amount` DECIMAL(15,2) NULL AFTER `special_discount_document`,
            ADD INDEX `idx_members_special_discount` (`special_discount_id`),
            ADD CONSTRAINT `fk_members_special_discount` FOREIGN KEY (`special_discount_id`) REFERENCES `special_discounts`(`id`) ON DELETE SET NULL
    ",
    'down' => "
        ALTER TABLE `members`
            DROP FOREIGN KEY `fk_members_special_discount`,
            DROP INDEX `idx_members_special_discount`,
            DROP COLUMN `special_discount_id`,
            DROP COLUMN `special_discount_document`,
            DROP COLUMN `discount_amount`
    ",
];
