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