split upgrade.sql into more logical pieces