The reason I started wondering about this was because I've suffered from migraines since I was around 15, but after a long time of fiddling with my diet I haven't had any for well over 6 months. But then a couple of weeks ago I felt the usual symptoms of an oncoming mood swing - mainly, needing less & less sleep & feeling a little bit giddy. I thought I was going to have an upswing. But, as occasionally happens, I had the opposite, & hit a big nasty cloud of depression. Then I came down with a migraine. The silver lining there is that when I have a migraine, there's very little I can think about other than the pain in my head, so it sort of stopped the depression in its tracks. When the migraine lifted, I felt better in general, but after a couple of days the depression hit again. Then I got another migraine!!! After ages not having any, to have 2 within 2 weeks, along with the depression, struck me as pretty suspicious.
It's pretty easy to say that migraine sufferers would of course feel the occasional bout of depression, because migraines are just ... well, horrible. But in my example, the depression hit first. This isn't always the case - usually I don't get migraines whenever I'm depressed, & when my migraines were frequent I can't recall them coinciding with any of my mood swings (but it's difficult to accurately recall as up until a few years ago I didn't really register the mood swings as being out of the ordinary, & even after that I wasn't really sure what the mood swings were). So I thought I'd Google it. Hooray for Google, the bringer of all wisdom ...
Unfortunately it didn't bring me all that much. After ploughing through several articles, some of which were so academically written it was like they were in another language, I got the general idea that YES, there is a link between bipolar disorder & migraines, but NO, nobody really knows what it is & why. I've linked one of the articles for your perusal.
Apparently both bipolar diorder & migraines are what they call 'comorbid' conditions, & can & often do occur in the same person at the same time, but without causing or affecting each other. It appears to be a simple case of having the right (or wrong) sort of brain - a brain that is home to bipolar disorder would also be a suitable habitat for migraines as well. (Feel free to correct me if I'm wrong, my in-depth reasearch begins & ends with what I dig up online.)
So there is a link, but so far no real information on that link exists, pending further studies. I shall have to keep an eye out for further studies; If anyone hears more on this, I'd love to hear it.