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/20221223214711_create_withd...

20 lines
715 B

defmodule Explorer.Repo.Migrations.CreateWithdrawals do
use Ecto.Migration
def change do
create table(:withdrawals, primary_key: false) do
add(:index, :integer, null: false, primary_key: true)
add(:validator_index, :integer, null: false)
add(:amount, :numeric, precision: 100, null: false)
timestamps(null: false, type: :utc_datetime_usec)
add(:address_hash, references(:addresses, column: :hash, on_delete: :delete_all, type: :bytea), null: false)
add(:block_hash, references(:blocks, column: :hash, on_delete: :delete_all, type: :bytea), null: false)
end
create(index(:withdrawals, [:address_hash]))
create(index(:withdrawals, [:block_hash]))
end
end