class CreateInventoriesMoves < ActiveRecord::Migration
  def change
    create_table :inventories_moves do |t|
      t.belongs_to :inventory, index: true
      t.belongs_to :product, index: true

      t.belongs_to :purchase, index: true
      t.belongs_to :sale, index: true

      t.decimal :quantity, default: 0, null: false
      t.string	:move_type, null: false, limit: 1
      t.timestamps null: false
    end
  end
end
