prop/priv/repo/migrations/20260329190247_add_weather_queued_to_qsos.exs
Graham McIntire c38596cc36
Add QsoWeatherEnqueueWorker cron job to auto-fetch weather for new QSOs
Oban cron worker runs every 4 hours, finds QSOs without weather data,
discovers nearby ASOS/sounding stations, and enqueues WeatherFetchWorker
jobs. Migrations run automatically on app start in production.
2026-03-29 14:11:03 -05:00

15 lines
493 B
Elixir

defmodule Microwaveprop.Repo.Migrations.AddWeatherQueuedToQsos do
use Ecto.Migration
def change do
alter table(:qsos) do
add :weather_queued, :boolean, default: false, null: false
end
# Backfill existing rows — they were already processed by the import script
execute "UPDATE qsos SET weather_queued = true", "SELECT 1"
# Partial index for fast lookup of unprocessed QSOs
create index(:qsos, [:weather_queued], where: "weather_queued = false")
end
end