A migraine is among the most debilitating conditions in medicine—a blinding, throbbing pain that typically lasts between four and 72 hours. There is no cure.

Yet, a few hours or days before the dreaded headache sets in, subtle symptoms emerge: Some people feel unusually fatigued, cranky or anxious. Some have yawning jags. Others have food cravings or excessive thirst.

If...