Thank you for sharing your story with us. You're not alone in feeling this way. Parenting in general is difficult and when chronic illness is added in, it complicates everything.
I understand feeling like you're "failing at all levels," I felt that way too while I was raising my two children years ago living with debilitating chronic head and neck pain. They saw me at my worst and while I was overmedicated. I am thankfully every day that they are both well adjusted adults with fulfilling careers and partners.
The thing about migraine is we can do all the things to perfection (in regards to mitigating it) and still get a migraine attack. It's the nature of the disease.
Try not to be too hard on yourself, you're doing your best! Will you keep me posted on how you are doing? I'm sending you wishes for a low pain day, Nancy Harris Bonk, Patient Leader/Moderator (team member)