Upgrade contest scripts and change some tables