Anti-depressants come in many kinds working on different chemical pathways in the brain.
Migraine can also be caused/triggered by different things.
Each person is unique in thier response to,medications or suceptibilty to side effects.
There is no way to know in advance if any one person will have a migraine in response to taking a medication.
Having said that, I encourage you to discuss your concerns and share your experience with 5http with the provider(s) who may write your prescription for anti-depressants.
There is research linking migraine and the serotonin system, but some people have migraine for other reasons (injury, hormones, chemical sensitivity to name but three of very very many) and some (but not all) anti-depressants work on the serotonin system. Some medications used to treat migraine also effect the serotonin system (for example both imetrx and zofran that I have for migraine come with a warning of side effects related to Serotoninergic syndrome).
When I saw the warnings on these and that they were similar to other medications I already had (and said "check with your doctor if you are also taking) I did just that. I asked my doctor and my pharmacist as I had, like you, had previous negative reactions.
We worked out a tiered dosage plan that minimizes the potential for piggy-backing negative effects while still getting theraputic benefit.
Your doctor and pharmacist are there to make sure you get the greatest theraputic benefit with minimum side effects. But there is really no way to know until you try.
Again, I encourage you to just share the very same thing you did with us, but with your healthcare team.
They can work to find the best fit for you.
(Tanget: last time I was at the e.r. for nerve pain and muscle spasm I waited an additional 30 min for treatment as the dr tried to find a medication they had that I could take. I have many med allergies and adverse reactions and three daily prescriptions. I also have conditions that some medications are warned against. I keep a list on my phone to show any new doctor. It was worth the delay to have all concerns, comorbities, and contraindications considered before injecting me.)