Add a UniqueCache to handle unique constraints