fix unique constraints