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.
15 lines
493 B
Elixir
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
|