The order_versions table contains exactly two payloads per order_ref, with different received_at timestamps. Write a query to compare the earlier payload with the later one for three fields: top-level status as text, top-level amount as a number, and shipping.city as text.
Return one row per changed field with order_ref, field, old_value and new_value. Return both values as text, with the amount represented numerically. A value becoming absent, or an absent value becoming present, is a change; two absent values are unchanged and remain NULL.
Compare extracted field values, not document key order. A numeric string and the equivalent JSON number are the same amount.
Ordering: Sort by order_ref, then field in ascending order.