Firstly, WOW. Being in that much pain, for so much time, it is not surprising that it lead to an attempt to take your own life.
I don't know where you live. I live in the UK, and personally, if I were in the same situation, I would move to a new doctors practice, get a fresh GP, and make an appointment with them in which I was straight-up honest. I would say, 'I've been on codeine for 3 years, it has stopped working, my previous doctor couldn't think of an alternative solution to my pain, and I am terrified that I am going to end up turning to dangerous, illicit drugs for relief if nothing legal is available to help'. Tell them about your past incidents of attempted suicide. Be honest - a good doctor simply shouldn't turn away a patient who is begging for legitimate help. If the next doctor you try doesn't have a solution? Try another. There are a lot of doctors out there, and it sounds like finding the right one may well be the most important thing for your quality of life.
Related to this...
LSD has been found to totally relieve all pain associated with cluster headaches. It's also been found to prevent them as well. I'm not saying you should go out and take LSD if you have a headache, just something on topic.
http://www.youtube.com/watch?v=FH2BrgMzql8
Seconded. I have also heard of similar effects from magic mushrooms. Of course, I do not recommend taking them if it against the law in your area. That said, I think there are a few trials going on around the world, investigating the links between LSD/Mushrooms and the cessation of headaches. You would probably find it difficult to get on to any kind of trial involving psychedelics, just because you state that you have psychosis. This makes using the psychedelics potentially more dangerous, so if you decide to, make sure that you have someone sober to keep an eye on you, and that there is a plan in place in case of a bad reaction. You do not say where you live. Is there any chance that, by pure luck, you live in Amsterdam where magic mushroom 'truffles' are so readily available?
Do not just ask for pain meds. Why are you having these migraines? Has your doctor had you thoroughly checked out? Multiple migraines a day, which are severe enough to lead to multiple suicide attempts, warrant a full physical examination. You've been having them for 7 years, do you know what initially brought them on? Ask to be referred beyond your GP, to specialists. State up-front that you need pain relief, immediately, but that you don't want to be on pain pills forever. You want answers. There are people more specialized in treating migraines than your general doctor, and I seem to recall that migraines aren't always best treated with pain pills, and that sometimes other medications work better (but I am not a doctor, I just feel like this is something I have heard). There are also other ways to deal with pain than simply blocking it out, and I have known a few people in my time who have dealt with severe, ongoing pain through meditation and visualization (although this is probably a very irritating thing to hear from some chick on the internet who has no way to begin to understand the pain you are suffering). Ask about access to support groups for people suffering chronic pain, and whether any alternative or cognitive pain-management is available to you, to back up the medication. If there are no support groups, go online and try to find pain management or even migraine-specific forums or chat groups - you should not have to feel alone in this, especially when so many other people are suffering similarly.
Good luck, sending positive vibes your way.
Good luck.