update the database