parent
d7d242e44b
commit
d3e258c431
@ -0,0 +1,25 @@ |
|||||||
|
defmodule Explorer.Repo.Migrations.InternalTransactionsAddToAddressHashIndex do |
||||||
|
use Ecto.Migration |
||||||
|
|
||||||
|
def change do |
||||||
|
execute( |
||||||
|
"CREATE INDEX IF NOT EXISTS internal_transactions_from_address_hash_partial_index on public.internal_transactions(from_address_hash, block_number DESC, transaction_index DESC, index DESC) WHERE (((type = 'call') AND (index > 0)) OR (type != 'call'));" |
||||||
|
) |
||||||
|
|
||||||
|
execute( |
||||||
|
"CREATE INDEX IF NOT EXISTS internal_transactions_to_address_hash_partial_index on public.internal_transactions(to_address_hash, block_number DESC, transaction_index DESC, index DESC) WHERE (((type = 'call') AND (index > 0)) OR (type != 'call'));" |
||||||
|
) |
||||||
|
|
||||||
|
execute( |
||||||
|
"CREATE INDEX IF NOT EXISTS internal_transactions_created_contract_address_hash_partial_index on public.internal_transactions(created_contract_address_hash, block_number DESC, transaction_index DESC, index DESC) WHERE (((type = 'call') AND (index > 0)) OR (type != 'call'));" |
||||||
|
) |
||||||
|
|
||||||
|
drop_if_exists( |
||||||
|
index( |
||||||
|
:internal_transactions, |
||||||
|
[:to_address_hash, :from_address_hash, :created_contract_address_hash, :type, :index], |
||||||
|
name: "internal_transactions_to_address_hash_from_address_hash_created" |
||||||
|
) |
||||||
|
) |
||||||
|
end |
||||||
|
end |
Loading…
Reference in new issue