Execute the query and update onUpgrade