diff --git a/priv/repo/migrations/20250213030301_remove_unused_indexes_and_columns.exs b/priv/repo/migrations/20250213030301_remove_unused_indexes_and_columns.exs new file mode 100644 index 000000000..d5d9f6172 --- /dev/null +++ b/priv/repo/migrations/20250213030301_remove_unused_indexes_and_columns.exs @@ -0,0 +1,22 @@ +defmodule NervesHub.Repo.Migrations.RemoveUnusedIndexesAndColumns do + use Ecto.Migration + + def up do + drop(index(:devices, [:connection_status])) + + alter table("devices") do + remove(:connection_status) + remove(:connection_established_at) + remove(:connection_disconnected_at) + remove(:connection_last_seen_at) + remove(:connection_metadata) + remove(:connection_types) + end + + drop(index(:device_connections, [:device_id, :established_at])) + end + + def down do + raise "One way migration" + end +end