-- Add columns for ELO correction functionality
ALTER TABLE spielmeldungen
ADD COLUMN exclude_from_elo BOOLEAN DEFAULT FALSE COMMENT 'Whether this match should be excluded from ELO calculations',
ADD COLUMN corrected_winner_id INT NULL DEFAULT NULL COMMENT 'Manually set winner ID for corrections',
ADD COLUMN corrected_at TIMESTAMP NULL DEFAULT NULL COMMENT 'When the correction was made',
ADD COLUMN corrected_by INT NULL COMMENT 'User ID who made the correction',
ADD CONSTRAINT fk_corrected_by_user FOREIGN KEY (corrected_by) REFERENCES Benutzer(BenutzerID) ON DELETE SET NULL;

-- Add an index for faster lookups of excluded matches
CREATE INDEX idx_exclude_from_elo ON spielmeldungen(exclude_from_elo);
CREATE INDEX idx_corrected_winner ON spielmeldungen(corrected_winner_id);
