:fix Correct behaviour of upsert on duplicate keys