More database magic + ugprades (that probably don't work)