diff --git a/apps/explorer/lib/explorer/chain/contract_method.ex b/apps/explorer/lib/explorer/chain/contract_method.ex index c4716cde00..8d1c381571 100644 --- a/apps/explorer/lib/explorer/chain/contract_method.ex +++ b/apps/explorer/lib/explorer/chain/contract_method.ex @@ -72,6 +72,7 @@ defmodule Explorer.Chain.ContractMethod do from( contract_method in __MODULE__, where: contract_method.identifier == ^method_id, + order_by: [asc: contract_method.inserted_at], limit: ^limit ) end diff --git a/apps/explorer/priv/repo/migrations/20240806162644_add_contract_methods_inserted_at_index.exs b/apps/explorer/priv/repo/migrations/20240806162644_add_contract_methods_inserted_at_index.exs new file mode 100644 index 0000000000..b025f59ebe --- /dev/null +++ b/apps/explorer/priv/repo/migrations/20240806162644_add_contract_methods_inserted_at_index.exs @@ -0,0 +1,7 @@ +defmodule Explorer.Repo.Migrations.AddContractMethodsInsertedAtIndex do + use Ecto.Migration + + def change do + create(index(:contract_methods, [:inserted_at])) + end +end