Resolving unique constraint violations