Improving unique constraints in the models