finish the update of database