<?php
declare(strict_types=1);

return [
    'up' => "
ALTER TABLE `carnets`
    ADD COLUMN `dependent_type` VARCHAR(30) NULL DEFAULT NULL COMMENT 'spouses, children, temporary_members' AFTER `member_id`,
    ADD COLUMN `dependent_id` BIGINT UNSIGNED NULL DEFAULT NULL AFTER `dependent_type`,
    ADD COLUMN `card_variant` VARCHAR(20) NOT NULL DEFAULT 'main' COMMENT 'main or dependent' AFTER `carnet_type`,
    ADD INDEX `idx_carnets_dependent` (`dependent_type`, `dependent_id`);
",
    'down' => "
ALTER TABLE `carnets`
    DROP INDEX `idx_carnets_dependent`,
    DROP COLUMN `card_variant`,
    DROP COLUMN `dependent_id`,
    DROP COLUMN `dependent_type`;
",
];
