Sometimes you have to do what's best for yourself. Drinking/drugs combined with a rocky relationship while trying to stay sober is rough. I've been through it myself. You can't fight another person's demons while battling your own.
As time passes and you develop more sober time, you know you will be able to look back on this as the right decision. Never let the fear of being alone drive your decisions.