Files
meseo-staging/scripts/add-missing-indexes.sql
T
Andres Resiri 70daeb214a
CI / Quality gate (push) Has been cancelled
Initial project commit for Coolify staging
2026-08-03 10:45:41 -04:00

16 lines
742 B
SQL

-- ============================================================
-- MISSING INDEXES — Run in Neon SQL Editor
-- ============================================================
-- These indexes exist in prisma/schema.prisma but are NOT on the
-- production database (lost during schema conflict resolution).
-- CONCURRENTLY ensures no table locks during creation.
-- ============================================================
-- SiteEvent: admin Signal Overview cross-brand queries
-- Without this, groupBy on 30M rows scans the entire table
CREATE INDEX CONCURRENTLY IF NOT EXISTS "SiteEvent_eventType_timestamp_idx"
ON "SiteEvent" ("eventType", "timestamp");
-- Verify:
-- SELECT indexname FROM pg_indexes WHERE tablename = 'SiteEvent';