-- Migration: Update my_tischtennis table TEXT fields to LONGTEXT for encrypted data
-- Date: 2025-11-21
-- For MariaDB/MySQL
-- 
-- Problem: Encrypted data can be very long, and TEXT fields (max 65KB) are too small
-- Solution: Change to LONGTEXT (max 4GB) for all encrypted fields

-- Update user_data to LONGTEXT
ALTER TABLE `my_tischtennis` 
MODIFY COLUMN `user_data` LONGTEXT NULL;

-- Update access_token to LONGTEXT
ALTER TABLE `my_tischtennis` 
MODIFY COLUMN `access_token` LONGTEXT NULL;

-- Update refresh_token to LONGTEXT
ALTER TABLE `my_tischtennis` 
MODIFY COLUMN `refresh_token` LONGTEXT NULL;

-- Update cookie to LONGTEXT
ALTER TABLE `my_tischtennis` 
MODIFY COLUMN `cookie` LONGTEXT NULL;

-- Update encrypted_password to LONGTEXT
ALTER TABLE `my_tischtennis` 
MODIFY COLUMN `encrypted_password` LONGTEXT NULL;

-- Update club_id to LONGTEXT (was VARCHAR, but encrypted data can be longer)
ALTER TABLE `my_tischtennis` 
MODIFY COLUMN `club_id` LONGTEXT NULL;

-- Update club_name to LONGTEXT (was VARCHAR, but encrypted data can be longer)
ALTER TABLE `my_tischtennis` 
MODIFY COLUMN `club_name` LONGTEXT NULL;

-- Update fed_nickname to LONGTEXT (was VARCHAR, but encrypted data can be longer)
ALTER TABLE `my_tischtennis` 
MODIFY COLUMN `fed_nickname` LONGTEXT NULL;

