Class: CreateExchanges

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/economy/install/templates/migration.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/generators/economy/install/templates/migration.rb', line 2

def change
  create_table :exchanges do |t|
    t.string :service
    t.string :from
    t.string :to
    t.decimal :rate, precision: 24, scale: 12

    t.timestamps null: false
  end

  add_index :exchanges, %i(from to)
end