Add uniqueness constraints for student training models; check for integrity errors