CREATE TABLE IF NOT EXISTS travel_1_main_admin_transfers (
    id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
    current_admin_id BIGINT UNSIGNED NOT NULL,
    target_user_id BIGINT UNSIGNED NOT NULL,
    token_hash CHAR(64) NOT NULL,
    expires_at DATETIME NOT NULL,
    confirmed_at DATETIME NULL,
    cancelled_at DATETIME NULL,
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (id),
    KEY idx_main_admin_transfer_current (current_admin_id),
    KEY idx_main_admin_transfer_target (target_user_id),
    KEY idx_main_admin_transfer_expiry (expires_at),
    FOREIGN KEY (current_admin_id) REFERENCES travel_1_users(id) ON DELETE CASCADE,
    FOREIGN KEY (target_user_id) REFERENCES travel_1_users(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
