Not medical advice, though a gf used to get these, mostly manageable with daily B12 and folic acid supplementation, occasionally receiving an imitrex injection when bad enough. Other options listed below; all have side effects and each person responds differently.
Prevention
B12
Folic acid
Mitigation
Magnesium
Ibuprofen
Propranolol - rx
Treatment
Imitrex - rx, subc inj