was your helmet too tight? were you drinking enough water?
if you get a lot of migraines, you can ignore my questions but it seems to me that this was unusual and shouldn't happen a lot! keep riding and stay hydrated!