diff --git a/route_sql/list_changes.sql b/route_sql/list_changes.sql index 4b5e69e..50e79b9 100644 --- a/route_sql/list_changes.sql +++ b/route_sql/list_changes.sql @@ -3,7 +3,7 @@ agg as ( SELECT ol.doc->>'user' "user" ,quota_rep_descr - ,ol.doc->>'stamp' stamp + ,to_char((ol.doc->>'stamp')::timestamptz,'DD/Mon HH:MI:SS') stamp ,ol.doc->>'tag' tag ,ol.doc->>'message' "comment" ,jsonb_pretty(ol.doc) doc @@ -24,6 +24,8 @@ group BY ,ol.doc->>'comment' ,jsonb_pretty(ol.doc) ,ol.id +ORDER BY + (ol.doc->>'stamp')::timestamptz desc ) SELECT jsonb_agg(row_to_json(agg)::jsonb ORDER BY agg.stamp desc) x from agg \ No newline at end of file