Commit Graph

3 Commits

Author SHA1 Message Date
David Bomba 142bc03658 fix: Add idempotency checks to all Elasticsearch migrations
Problem:
- Running elastic:rebuild --model=X failed when indexes already existed
- Migrations threw "index already exists" errors in production
- Command runs ALL migrations even when rebuilding single model

Solution:
- Added existence checks to all 12 migration files
- Migrations now skip creation if index already exists
- Safe to run multiple times without errors

Changes:
- Added ClientBuilder import to all migrations
- Check indices()->exists() before creating
- Return early if index already exists
- Removed force drop from recurring_invoices migration

Benefits:
- Production-safe partial rebuilds
- No "already exists" errors
- Idempotent migrations
- Clean log output

Files modified:
- All 12 files in elastic/migrations/*.php
2025-11-26 02:15:02 +00:00
David Bomba 2795faa0fe Improving coverage of Global Search 2025-09-01 18:10:37 +10:00
David Bomba 8231d967dd Elastic migrations 2025-09-01 14:21:17 +10:00