Fix: SQL error when a key is both indexed and unique.