Magnesium

I went to the ER today because I’ve had a bad migraine for a few days and my OB suggested it. They gave me some meds that were safe (not narcotics) but it didn’t help and my blood pressure was 142/77 so they gave me a small bag of magnesium to see if it would help. But I read really mixed things on this... any insight?