defmodule Towerops.Repo.Migrations.AddDisplayOrderToDevices do
  use Ecto.Migration

  def change do
    alter table(:devices) do
      add :display_order, :integer
    end

    # Composite index for efficient sorting within sites (site + display_order + name)
    create index(:devices, [:site_id, :display_order, :name])
  end
end
