cirandas.net

ref: master

plugins/stock/db/migrate/20140605020553_create_stock_plugin_allocation.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
class CreateStockPluginAllocation < ActiveRecord::Migration
  def self.up
    create_table :stock_plugin_allocations do |t|
      t.integer :place_id
      t.integer :product_id
      t.decimal :quantity

      t.timestamps
    end
    add_index :stock_plugin_allocations, :place_id
    add_index :stock_plugin_allocations, :product_id
    add_index :stock_plugin_allocations, [:place_id, :product_id]
  end

  def self.down
    drop_table :stock_plugin_allocations
  end
end