Added queries to upgrade