Revert "Upgrade db code 2"

This reverts commit b63eae9b3c9eb4bf38139dedba644789cc069030.