I occasionally have migraines but have never determined any cause – food, tiredness or otherwise.
I suspect there’s a lot of confirmation bias going on here – you get a migraine and then look for a cause – coffee, cheese, fatigue, etc. What you forget is all other times you ate that food or where tired and didn’t suffer any ill consequences. I don’t think anyone knows what starts a migraine but I’m rather skeptical about these trigger events.