prop/priv/repo/migrations/20260716122845_add_contacts_callsign_indexes.exs
Graham McInitre 93b8f881e2 perf: batch fixes for site-wide audit — indexes, N+1, streams, atomicity
- Add index on weather_stations(station_type, lat, lon) for nearby_stations
- Add UPPER(station1/2) expression indexes for callsign search
- Batch sync_network ~3K individual Repo.insert calls into one insert_all
- Batch Oban.insert calls in insert_unique into Oban.insert_all
- Log warnings on station elevation Repo.update errors instead of discarding
- Wrap reconcile_mission_paths delete+insert in Repo.transaction
- BeaconLive.Index: targeted stream_insert/delete instead of full re-query+push_patch
- RoverPlanningLive.Show: re-fetch single path instead of re-querying all
- PskrSpotsLive: convert to LiveView streams, add 60s auto-refresh
- ImportConfetti: add missing phx-update=ignore
2026-07-16 07:31:19 -05:00

13 lines
435 B
Elixir

defmodule Microwaveprop.Repo.Migrations.AddContactsCallsignIndexes do
use Ecto.Migration
def up do
execute("CREATE INDEX contacts_upper_station1_idx ON contacts (UPPER(station1))")
execute("CREATE INDEX contacts_upper_station2_idx ON contacts (UPPER(station2))")
end
def down do
execute("DROP INDEX IF EXISTS contacts_upper_station1_idx")
execute("DROP INDEX IF EXISTS contacts_upper_station2_idx")
end
end