-- Fixes a real bug: visitor_token was UNIQUE, but a returning visitor (same browser,
-- same localStorage token) legitimately gets a new chat_sessions row every time they
-- start a new chat after their previous one closed — colliding with the old closed
-- row's unique constraint and throwing a fatal PDOException. The lookup only ever
-- needs an index for speed, not global uniqueness.
ALTER TABLE chat_sessions DROP INDEX visitor_token;
ALTER TABLE chat_sessions ADD INDEX visitor_token_idx (visitor_token);
