break up upgrade sql script into more logical pieces