<?php
declare(strict_types=1);

return [
    'up' => "
        ALTER TABLE `facility_time_slots`
            ADD COLUMN `access_type` VARCHAR(20) NOT NULL DEFAULT 'open' COMMENT 'open, members_only, vip' AFTER `time_tier`,
            ADD COLUMN `member_price` DECIMAL(10,2) NULL AFTER `price`,
            ADD COLUMN `guest_price` DECIMAL(10,2) NULL AFTER `member_price`,
            ADD COLUMN `carnet_guest_price` DECIMAL(10,2) NULL AFTER `guest_price`,
            ADD INDEX `idx_fts_access` (`access_type`);

        ALTER TABLE `pool_bookings`
            ADD COLUMN `booker_type` VARCHAR(20) NULL DEFAULT 'member' COMMENT 'member, player, guest, carnet_guest' AFTER `pool_config_id`,
            ADD COLUMN `booker_member_id` BIGINT UNSIGNED NULL AFTER `booker_type`,
            ADD COLUMN `carnet_guest_entry_id` BIGINT UNSIGNED NULL AFTER `booker_member_id`
    ",
    'down' => "
        ALTER TABLE `pool_bookings`
            DROP COLUMN `carnet_guest_entry_id`,
            DROP COLUMN `booker_member_id`,
            DROP COLUMN `booker_type`;
        ALTER TABLE `facility_time_slots`
            DROP INDEX `idx_fts_access`,
            DROP COLUMN `carnet_guest_price`,
            DROP COLUMN `guest_price`,
            DROP COLUMN `member_price`,
            DROP COLUMN `access_type`
    ",
];
