I wonder if there might be something in cerebrospinal fluid that doesn't show up in blood tests.
I read an article recently about a doctor who discovered that many of her patients with treatment-refractory major depression had clear metabolic abnormalities that showed when looking at cerebrospinal fluid and addressing them made dramatic improvements.
I don't think "magnesium deficiency" really constitutes an explanation in itself. One of my parents and my sibling have had migraines, but I don't. If you blame it on magnesium, then it only moves the question to why does one person have a deficiency and another not? It's certainly not because I go to great lengths to have a balanced diet or take supplements.
I tried supplementing with magnesium, and the severity (but not the frequency) of migraine attacks definitely decreased. Ultimately I gave up on Mg because of the gastrointestinal side effects.
Butterburr extract has a couple of clinical trials as a preventative, but I didn't find that it did anything for me.
Chlorpheniramine maleate (the antihistamine) worked as a preventative, reducing both severity and frequency of attacks, but I didn't like the side effects (it's also an SNRI) and discontinuation was ugly.