- New rows are added for incoming records with unique keys that don’t exist in the target table.
- For records matching existing unique keys, a new row is added only when the incoming data differs from the existing record.
- New rows are assigned a start date and a
nullend date (indicating it’s currently valid). - If the unique key of the new record matched an existing record, the existing row is assigned an end date to mark when it stopped being valid.
- This creates a complete timeline showing how data evolved over time.
Parameters
Example: Route assignment history
A vehicle assignment table tracks which route each vehicle is assigned to over time. When a vehicle is assigned to a new route, Prophecy preserves the previous assignment and creates a new current record. In this example, Determine new records by checking timestamp column is enabled, andassigned_at is the timestamp column.
Existing target table
Incoming data set
Updated target table
Because the incoming row matches an existing
vehicle_id but has a newer assigned_at value, Prophecy preserves the existing row by assigning it a valid_to date and inserts a new current row with a null valid_to value. This creates a complete history of the vehicle’s route assignments rather than overwriting the previous assignment.
