Oxycodone during pregnancy?

My doctors prescribed this for my migraines and said its a category B and totally safe to take during pregnancy. It still kinda freaks me out since it's a pain killer. Anyone else had experience with this during pregnancy? Thanks!