-- Fix missing columns in global event tables
USE `global`;

-- Check current structure and add missing columns to event table
ALTER TABLE `event` 
ADD COLUMN IF NOT EXISTS `server` tinyint(3) unsigned DEFAULT 0;

-- Check current structure and add missing columns to event_attack table  
ALTER TABLE `event_attack`
ADD COLUMN IF NOT EXISTS `server` tinyint(3) unsigned DEFAULT 0;

-- Verify the structure now includes server column
SELECT 'Event table structure:' as info;
DESCRIBE `event`;

SELECT 'Event_attack table structure:' as info;  
DESCRIBE `event_attack`;

-- Show sample of existing data
SELECT 'Sample event data:' as info;
SELECT COUNT(*) as total_events, match_id FROM `event` GROUP BY match_id LIMIT 5;

SELECT 'Sample event_attack data:' as info;
SELECT COUNT(*) as total_attacks, match_id FROM `event_attack` GROUP BY match_id LIMIT 5;