Swap the one outlier (client-interests-tab.tsx) from Vaul Drawer to Sheet side=right so every detail-preview surface uses the same primitive. Document the doctrine: Sheet for side panels on both desktop and mobile; Vaul Drawer reserved for mobile-only bottom-sheet UX (currently just MoreSheet). Closes ui/ux M11. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
26 lines
1.3 KiB
SQL
26 lines
1.3 KiB
SQL
-- 0057_search_fts_indexes.sql
|
|
-- ----------------------------------------------------------------------------
|
|
-- Backing GIN indexes for the to_tsvector expressions used by
|
|
-- src/lib/services/search.service.ts. Without these the full-text
|
|
-- predicates (`to_tsvector('simple', col) @@ to_tsquery('simple', $1)`)
|
|
-- sequential-scan every row in clients / yachts / companies / interests
|
|
-- on each search, which becomes painful at scale.
|
|
--
|
|
-- Built with CREATE INDEX CONCURRENTLY so the index build doesn't lock
|
|
-- the table for new writes. That means each statement must run OUTSIDE
|
|
-- a transaction — the custom `scripts/db-migrate.ts` runner detects
|
|
-- CONCURRENTLY and runs the statement standalone.
|
|
|
|
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_clients_fulltext
|
|
ON clients USING gin (to_tsvector('simple', coalesce(full_name, '')));
|
|
--> statement-breakpoint
|
|
|
|
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_residential_clients_fulltext
|
|
ON residential_clients USING gin (to_tsvector('simple', coalesce(full_name, '')));
|
|
--> statement-breakpoint
|
|
|
|
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_yachts_fulltext
|
|
ON yachts USING gin (to_tsvector('simple', coalesce(name, '') || ' ' || coalesce(builder, '')));
|
|
|
|
-- companies search uses plain ILIKE only (no to_tsvector); index omitted.
|