-- Run outside a transaction. Concurrent creation keeps normal inserts available. CREATE INDEX CONCURRENTLY IF NOT EXISTS "GeneratedImage_created_id_idx" ON public."GeneratedImage" ("createdAt" DESC, id DESC); CREATE INDEX CONCURRENTLY IF NOT EXISTS "Message_v2_video_created_id_idx" ON public."Message_v2" ("createdAt" DESC, id DESC) WHERE role = 'assistant' AND ( permanent_video_url IS NOT NULL OR temporary_video_url IS NOT NULL OR parts::text ILIKE '%