Write a query to return each customer’s first row in status_events and later rows whose status differs from the preceding row. Order each history by event_at, then event_id, both ascending.
Treat NULL as a comparable status state: a value-to-NULL or NULL-to-value transition is a change, while NULL-to-NULL is not. Return the preceding status as prev_status.
Return event_at as text using strftime with '%Y-%m-%d %H:%M:%S'.
Ordering: Sort by customer, then event_at, then event_id in ascending order.