What ever you take your baby takes! Surely the doctor that prescribed this knew you were breast feeding right? If not he needs to be told right away. Good luck and try your best to deal with the pain through alternative means for the sake of your child. However, if your doctor feels it is necessary for you to be on a narcotic pain reliever then you may want to pump breast milk prior to taking pain medication and give formula in between if necessary. Hope this helps. Been there, done that.
Sharon