defmodule Microwaveprop.Repo.Migrations.MakePropagationScoresFactorsNullable do
  use Ecto.Migration

  @moduledoc """
  Factors are only populated for analysis-hour (f00) rows now; forecast
  hours f01-f18 skip the JSONB write entirely to cut scoring+upsert
  wall time. That means the column must allow NULL.

  The column itself stays on the table (not dropped) so point_detail
  can still pull the breakdown for the current hour without a second
  table lookup.
  """

  def change do
    alter table(:propagation_scores) do
      modify :factors, :map, null: true, from: {:map, null: false}
    end
  end
end
