class CreatePurchaseDetails < ActiveRecord::Migration
  def change
    create_table :purchase_details do |t|
      t.belongs_to :purchase, index: true
      t.belongs_to :product, index: true
      
      t.integer :quantity
      t.decimal :price, precision: 10, scale:2, default: 0.00, null: false
      t.decimal :amount, precision: 10, scale:2, default: 0.00, null: false

      t.timestamps null: false
    end
  end
end
