Tbh I would rather have to take painkillers sometimes than do keto intermittent fasting every day with organic vegan weeks.
Besides, you might be confusing correlation with causation a bit? My sister and mother probably eat healthier than I do and still get disabling migraines sometimes. My diet is "basically whatever, just no animal parts and not too much junk food" and I've never gotten one.