diff --git a/apps/explorer/priv/repo/migrations/20191121064805_add_block_hash_and_block_index_to_logs.exs b/apps/explorer/priv/repo/migrations/20191121064805_add_block_hash_and_block_index_to_logs.exs index ce74a97311..4771653646 100644 --- a/apps/explorer/priv/repo/migrations/20191121064805_add_block_hash_and_block_index_to_logs.exs +++ b/apps/explorer/priv/repo/migrations/20191121064805_add_block_hash_and_block_index_to_logs.exs @@ -34,5 +34,9 @@ defmodule Explorer.Repo.Migrations.AddBlockHashAndBlockIndexToLogs do DROP CONSTRAINT logs_pkey, ADD PRIMARY KEY (transaction_hash, block_hash, index); """) + + drop(unique_index(:logs, [:transaction_hash, :index])) + + create_if_not_exists(index(:logs, [:transaction_hash, :index])) end end