ALTER TABLE kanadi_validator_sessions
ALTER COLUMN bundle_session_id DROP NOT NULL;

ALTER TABLE kanadi_validator_sessions
ADD COLUMN IF NOT EXISTS session_id VARCHAR(255),
ADD COLUMN IF NOT EXISTS solve_id VARCHAR(255),
ADD COLUMN IF NOT EXISTS result VARCHAR(50),
ADD COLUMN IF NOT EXISTS score INTEGER,
ADD COLUMN IF NOT EXISTS confidence FLOAT,
ADD COLUMN IF NOT EXISTS processing_time INTEGER,
ADD COLUMN IF NOT EXISTS evidence JSONB,
ADD COLUMN IF NOT EXISTS decrypted_data JSONB;

CREATE INDEX IF NOT EXISTS idx_validator_sessions_session_id ON kanadi_validator_sessions(session_id);
CREATE INDEX IF NOT EXISTS idx_validator_sessions_solve_id ON kanadi_validator_sessions(solve_id);
CREATE INDEX IF NOT EXISTS idx_validator_sessions_result ON kanadi_validator_sessions(result);