Added scripts from the upgrade.sql as per the instructions from Tony