migrate history_database to just being a list of rows for outputs AND spends.