Remove duplicate agent index migration

Removed 20260115010756_add_agent_query_composite_indexes.exs which
was a duplicate of 20260115010646_add_composite_indexes_for_agent_queries.exs.

Both had already run but the duplicate one used create_if_not_exists
so it didn't fail. Cleaned up to avoid confusion.
This commit is contained in:
Graham McIntire 2026-01-15 07:29:49 -06:00
parent 54b08bfb18
commit ccae030569
No known key found for this signature in database

View file

@ -1,21 +0,0 @@
defmodule Towerops.Repo.Migrations.AddAgentQueryCompositeIndexes do
use Ecto.Migration
def change do
# Composite index for agent assignment queries that filter by both agent_token_id and enabled
# This improves queries like: WHERE agent_token_id = ? AND enabled = true
create_if_not_exists index(:agent_assignments, [:agent_token_id, :enabled])
# Composite index for filtering agents by organization and enabled status
# This improves queries like: WHERE organization_id = ? AND enabled = true
create_if_not_exists index(:agent_tokens, [:organization_id, :enabled])
# Composite index for finding online agents (organization + last_seen_at)
# This improves queries that filter by org and sort by last_seen_at
create_if_not_exists index(:agent_tokens, [:organization_id, :last_seen_at])
# Composite index for equipment assignment queries (equipment_id + enabled)
# This improves queries that check if equipment has an active assignment
create_if_not_exists index(:agent_assignments, [:equipment_id, :enabled])
end
end