A migraine headache is caused by two factors: the enlargement of blood vessels in your temporal lobe, and the release of chemicals due to the enlargement. When your blood vessels dilate, the nerves that are wrapped around them secrete a chemical that worsens inflammation, pain and creates severe discomfort.
The reason for upset stomach and nausea during a migraine is the activation and overstimulation of the sympathetic nervous system. The sympathetic nervous system is linked to the areas of the brain that deal with stress and pain; it is also linked to the "fight or flight" response. The triggering of the SNS causes unsettling in the stomach which can lead to diarrhea and vomiting. To make matters worse, the SNS postpones the digestive process, keeping everything blocked up in the stomach and is unable to be absorbed by the small intestine. This is the reason why most medications are ineffective.