prop/priv/repo/migrations/20260421142436_rename_propagation_mechanism_status.exs
Graham McIntire f4f44b5ebe
refactor(contacts): rename propagation_mechanism_status -> mechanism_status
Column name now matches the type key used everywhere else:
  :hrrr -> hrrr_status, :weather -> weather_status,
  :terrain -> terrain_status, :mechanism -> mechanism_status

Drops the @status_column_overrides remap in BackfillEnqueueWorker
(status_column/1 is now a straight :"#{type}_status" derivation) and
the long-form references in Contact, ContactWeatherEnqueueWorker,
and MechanismClassifyWorker. Migration is a metadata-only RENAME
COLUMN + RENAME INDEX — safe to land in prod (no table rewrite,
brief catalog lock only).
2026-04-21 09:28:37 -05:00

21 lines
603 B
Elixir

defmodule Microwaveprop.Repo.Migrations.RenamePropagationMechanismStatus do
use Ecto.Migration
def up do
execute """
ALTER INDEX contacts_propagation_mechanism_status_pending_index
RENAME TO contacts_mechanism_status_pending_index
"""
rename table(:contacts), :propagation_mechanism_status, to: :mechanism_status
end
def down do
rename table(:contacts), :mechanism_status, to: :propagation_mechanism_status
execute """
ALTER INDEX contacts_mechanism_status_pending_index
RENAME TO contacts_propagation_mechanism_status_pending_index
"""
end
end