Incorporate update for blocks gas_used and gas_limit in initial migration

pull/753/head
Stamates 6 years ago
parent c6af8d363e
commit 742e543cdb
  1. 4
      apps/explorer/priv/repo/migrations/20180117221922_create_blocks.exs
  2. 10
      apps/explorer/priv/repo/migrations/20180831231919_modify_block_gas.exs

@ -4,8 +4,8 @@ defmodule Explorer.Repo.Migrations.CreateBlocks do
def change do
create table(:blocks, primary_key: false) do
add(:difficulty, :numeric, precision: 50)
add(:gas_limit, :integer, null: false)
add(:gas_used, :integer, null: false)
add(:gas_limit, :numeric, precision: 100, null: false)
add(:gas_used, :numeric, precision: 100, null: false)
add(:hash, :bytea, null: false, primary_key: true)
add(:miner_hash, references(:addresses, column: :hash, type: :bytea), null: false)
add(:nonce, :bytea, null: false)

@ -1,10 +0,0 @@
defmodule Explorer.Repo.Migrations.ModifyBlockGas do
use Ecto.Migration
def change do
alter table(:blocks) do
modify(:gas_used, :numeric, precision: 100)
modify(:gas_limit, :numeric, precision: 100)
end
end
end
Loading…
Cancel
Save