MySQL does not support CREATE INDEX IF NOT EXISTS syntax. Switch on database type to use IF NOT EXISTS for Postgres/SQLite and plain CREATE INDEX with duplicate key error suppression for MySQL. Fixes #2431