Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
blockscout/apps/explorer/priv/repo/migrations/20200421102450_pending_txs.exs

16 lines
535 B

defmodule Explorer.Repo.Migrations.PendingTxs do
use Ecto.Migration
def up do
execute(
"CREATE INDEX IF NOT EXISTS pending_txs_index ON transactions(inserted_at, hash) WHERE (block_hash IS NULL AND (error IS NULL OR (error != 'dropped/replaced')))"
)
drop_if_exists(index(:transactions, [:hash, :inserted_at], name: "transactions_hash_inserted_at_index"))
end
def down do
execute("DROP INDEX IF EXISTS pending_txs_index")
create_if_not_exists(index(:transactions, [:hash, :inserted_at]))
end
end