class CreateStockActivityItems < ActiveRecord::Migration
  def change
    create_table :stock_activity_items do |t|
      t.belongs_to :stock_activity, index: true, foreign_key: true
      t.belongs_to :product, index: true, foreign_key: true
      t.decimal :unitary_prize, precision: 13, scale: 3
      t.decimal :amount, precision: 13, scale: 3
      t.belongs_to :user, index: true, foreign_key: true
      t.decimal :item_prize, precision: 13, scale: 3

      t.timestamps null: false
    end
  end
end
