Make type/shard a unique index to allow sqlite REPLACE to do its thing.