fixed DB upgrade issues in V30 branch