Sha256: d17be97266c550d3eced7cfed0f95c571d211ee52ab3d5443ee824c3cb863853

Contents?: true

Size: 1.44 KB

Versions: 4

Compression:

Stored size: 1.44 KB

Contents

Sequel.migration do


  up do

    $stdout.puts "Running migration #{__FILE__}"

    binary = adapter_scheme == :postgres ? :bytea : :varchar

    alter_table :schema_info do
      add_column :magic, :varchar # network magic-head
      add_column :backend, :varchar # storage backend
    end

    next  if tables.include?(:blk)

    create_table :blk do
      primary_key :id
      column :hash, binary, :null => false, :unique => true, :index => true
      column :depth, :int, :null => false, :index => true
      column :version, :bigint, :null => false
      column :prev_hash, binary, :null => false, :index => true
      column :mrkl_root, binary, :null => false
      column :time, :bigint, :null => false
      column :bits, :bigint, :null => false
      column :nonce, :bigint, :null => false
      column :blk_size, :int, :null => false
      column :chain, :int, :null => false
      column :work, binary, :index => true
      column :aux_pow, binary
    end

    create_table :addr do
      primary_key :id
      column :hash160, String, :null => false, :index => true
    end

    create_table :addr_txout do
      column :addr_id, :int, :null => false, :index => true
      column :txout_id, :int, :null => false, :index => true
    end

    create_table :names do
      column :txout_id, :int, :null => false, :index => true
      column :hash, binary, :index => true
      column :name, binary, :index => true
      column :value, binary
    end

  end

end

Version data entries

4 entries across 2 versions & 1 rubygems

Version Path
bitcoin-ruby-0.0.3 lib/bitcoin/storage/sequel/migrations/001_base_schema.rb
bitcoin-ruby-0.0.3 lib/bitcoin/storage/utxo/migrations/001_base_schema.rb
bitcoin-ruby-0.0.2 lib/bitcoin/storage/sequel/migrations/001_base_schema.rb
bitcoin-ruby-0.0.2 lib/bitcoin/storage/utxo/migrations/001_base_schema.rb