A lot of migraines are caused by stress. Usually a blood vessel gets constricted or pinched by a muscle, and eventually the pressure results in a migraine. If the pain originates in the same place most of the time, you can talk to a doctor about having a botulin (Botox) injection-- this works really well, and recurrence is very rare.
If your migraines are few and far between, then medication is probably best. Talk to your GP and get a prescription for codeine--it works for me. I find that Ibuprofen doesn't work at all for me. Codeine doesn't work for 10% of the human population though because they lack the enzyme required to convert codeine (the prodrug) to morphine (the active drug), but it is always worth trying. It will make you drowsy though.
Another drug you might try, but which I find quite expensive and rather ineffective myself, is ergotamine (Cafergot). Sumatripan works for some, not for me.
Try (S)-ibuprofen first. If it doesn't work, try the others until you find one which is effective.
Be sure to discuss it with a proper doctor. These drugs can be quite dangerous--ergotamine, for one, leads to ergot poisoning then gangrene if taken in the wrong dosage. There is another drug which is related to lysergic acid, which I personally wouldn't want to risk.
Drinking does NOT cause migraines. It has no effect either way. Caffeine, by the way, won't cure a migraine but it does have a synergistic effect with a lot of drugs.
If you want a preventive measure, then I'd recommend 50-100mg of nicotinamide (vitamin B3) daily. We haven't quite worked out why this works, but it does. It is possibly due to the fact that nicotinamide is a vasodilator (dilates blood vessels), and this actuallyinhibits stress response. Proof of point: you will actually find B3 makes you feel calmer (though it causes a bit of flushing), and it becomes *really hard* to lose your temper.
Hope this helps.