We design extremely flexible ultrahigh-Q diamond-based double-heterostructure photonic crystal slab cavities by modifying the refractive index of the diamond. The refractive index changes needed for ultrahigh-Q cavities with $Q ~ 10^7$, are well within what can be achieved ($Delta n sim 0.02$). The cavity modes have relatively small volumes $V<2 (lambda /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.