<?php
declare(strict_types=1);

return [
    'up' => "
CREATE TABLE IF NOT EXISTS free_time_entries (
    id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    player_id INT UNSIGNED NULL,
    member_id INT UNSIGNED NULL,
    facility_id INT UNSIGNED NOT NULL,
    entry_date DATE NOT NULL,
    entry_time TIME NOT NULL,
    exit_time TIME NULL,
    activity_type VARCHAR(30) NOT NULL,
    is_member TINYINT(1) NOT NULL DEFAULT 0,
    amount_paid DECIMAL(15,2) NOT NULL DEFAULT 0.00,
    payment_id INT UNSIGNED NULL,
    status VARCHAR(20) NOT NULL DEFAULT 'active',
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    KEY idx_facility_date (facility_id, entry_date),
    KEY idx_player (player_id),
    KEY idx_member (member_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
    'down' => "DROP TABLE IF EXISTS free_time_entries",
];
