PASS: migrations applied twice
PASS: rollback removes partial chat
EXPLAIN: 12000 messages; cursor after row 9001; page 51
Limit  (cost=0.29..8.89 rows=51 width=69) (actual time=0.017..0.048 rows=51 loops=1)
  Buffers: shared hit=4
  ->  Index Scan using messages_history on messages  (cost=0.29..507.33 rows=3006 width=69) (actual time=0.015..0.037 rows=51 loops=1)
        Index Cond: ((chat_id = '2e792f72-9441-47f1-bf88-18cb19132cdb'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.009001+00'::timestamp with time zone, '1a322347-8a32-4b05-9695-5a34b1440088'::uuid)))
        Buffers: shared hit=4
Planning:
  Buffers: shared hit=6
Planning Time: 0.267 ms
Execution Time: 0.149 ms
PASS: history uses messages_history index
