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
