Update the database