Fixed ordering of recursive queries
Created master function to update all tenant stored functions
Made sure we drop functions before replacing