Mapping the changes to a target table and storing the transaction history in a history table