defmodule Explorer.Repo.Migrations.CreateBalances do use Ecto.Migration def change do create table(:balances, primary_key: false) do add(:address_hash, references(:addresses, column: :hash, type: :bytea), null: false) add(:block_number, :bigint, null: false) add(:value, :numeric, precision: 100, null: false) timestamps(null: false, type: :utc_datetime) end create(unique_index(:balances, [:address_hash, :block_number])) end end