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/20180212214442_create_recei...

29 lines
776 B

defmodule Explorer.Repo.Migrations.CreateReceipts do
use Ecto.Migration
def change do
create table(:receipts) do
add(:cumulative_gas_used, :numeric, precision: 100, null: false)
add(:gas_used, :numeric, precision: 100, null: false)
add(:index, :integer, null: false)
add(:status, :integer, null: false)
timestamps(null: false)
# Foreign keys
add(:receipt_id, references(:receipts, on_delete: :delete_all), null: true)
add(
:transaction_hash,
references(:transactions, column: :hash, on_delete: :delete_all, type: :bytea),
null: false
)
end
create(index(:receipts, :index))
create(index(:receipts, :status))
create(unique_index(:receipts, :transaction_hash))
end
end