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 4771653646..bd6d392e5a 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 @@ -7,8 +7,6 @@ defmodule Explorer.Repo.Migrations.AddBlockHashAndBlockIndexToLogs do add(:block_number, :integer) end - create(index(:logs, [:block_number])) - execute(""" UPDATE logs log SET block_hash = with_block.block_hash, @@ -25,6 +23,8 @@ defmodule Explorer.Repo.Migrations.AddBlockHashAndBlockIndexToLogs do ; """) + create(index(:logs, [:block_number])) + alter table(:logs) do modify(:block_hash, references(:blocks, column: :hash, type: :bytea), null: false) end