Added database upgrade mechanism.