Upgrade script and updates to migrations