We design extremely flexible ultrahigh-Q diamond-based doubleheterostructure photonic crystal slab cavities by modifying the refractive index of the diamond. The refractive index changes needed for ultrahigh-Q cavities with Q ? 107, are well within what can be achieved (?n ? 0.02). The cavity modes have relatively small volumes V2 (/n)3, making them ideal for cavity quantum electro-dynamic applications. Importantly for realistic fabrication, our design is flexible because the range of parameters, cavity length and the index changes, that enables an ultrahigh-Q is quite broad. Furthermore as the index modification is post-processed, an efficient technique to generate cavities around defect centres is achievable, improving prospects for defect-tolerant quantum architectures