fixed database downgrade bug from v0.7 to v0.6