lib/etl/control/destination.rb in activewarehouse-etl-0.8.2 vs lib/etl/control/destination.rb in activewarehouse-etl-0.8.3
- old
+ new
@@ -216,9 +216,14 @@
if result
#puts "Result: #{result.inspect}"
original_record = ETL::Row[result.symbolize_keys!]
original_record[scd_end_date_field] = timestamp
ETL::Engine.logger.debug "writing original record"
+
+ # if there is no truncate then the row will exist twice in the database
+ # need to figure out how to delete that old record before inserting the
+ # updated version of the record
+
buffer << original_record
end
row[scd_effective_date_field] = timestamp
row[scd_end_date_field] = '9999-12-31 00:00:00'
\ No newline at end of file