ALTER TABLE users ADD COLUMN directory_username VARCHAR(255);
UPDATE users SET directory_username = nickname WHERE auth_provider IS NOT NULL AND auth_provider <> 'local' AND directory_username IS NULL;
CREATE INDEX idx_users_directory_username ON users (LOWER(directory_username));
