# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20_181_015_141_952) do
  create_table 'coin_payment_transactions', force: :cascade do |t|
    t.decimal 'estimated_value', precision: 24
    t.string 'transaction_hash'
    t.string 'block_hash'
    t.datetime 'block_time'
    t.datetime 'estimated_time'
    t.integer 'coin_payment_id'
    t.decimal 'coin_conversion', precision: 24
    t.integer 'confirmations', default: 0
    t.index ['coin_payment_id'], name: 'index_coin_payment_transactions_on_coin_payment_id'
    t.index ['transaction_hash'], name: 'index_coin_payment_transactions_on_transaction_hash', unique: true
  end

  create_table 'coin_payments', force: :cascade do |t|
    t.string 'payable_type'
    t.integer 'coin_type'
    t.integer 'payable_id'
    t.string 'currency'
    t.string 'reason'
    t.integer 'price', limit: 8
    t.decimal 'coin_amount_due', precision: 24, default: '0'
    t.string 'address'
    t.string 'state', default: 'pending'
    t.datetime 'created_at'
    t.datetime 'updated_at'
    t.decimal 'coin_conversion', precision: 24
    t.index %w[payable_type payable_id], name: 'index_coin_payments_on_payable_type_and_payable_id'
  end

  create_table 'currency_conversions', force: :cascade do |t|
    t.integer 'currency'
    t.decimal 'price', precision: 24
    t.integer 'coin_type'
    t.datetime 'created_at'
    t.datetime 'updated_at'
  end

  create_table 'widgets', force: :cascade do |t|
    t.datetime 'created_at', null: false
    t.datetime 'updated_at', null: false
  end
end
