Make schema upgrade idempotent (INSERT IGNORE rather than INSERT)