Inserting history data into sqlite DB if out of date.