Cephalexin and macrobid

I went to the er because I was spotting 3 days ago and I got really worried. I have a uti and they put me on macrobid for 7 days twice a day. They just called me and said that I have a different type of bacteria in my urine that macrobid won’t fix, and to discontinue taking the macrobid and they’re putting me on 500 mg of cephalexin twice daily. I just worried about discontinuing taking the macrobid and going to another medicine. I’m 13 weeks 4 days. Will this harm my baby at all? They told me it’s safe for pregnancy but is this another medicine that they’d typically proscribe for a uti during pregnancy like macrobid?