class CreateSalesDetails < ActiveRecord::Migration
  def change
    create_table :sales_details do |t|
      t.belongs_to :sale, index: true
      t.belongs_to :product, index: true

      t.decimal	:quantity, null: false
      t.decimal :subtotal, precision: 10, scale:2, default: 0.00, null: false
      t.decimal :tax, precision: 10, scale:2, default: 0.00, null: false
      t.decimal :discount, precision: 10, scale:2, default: 0.00, null: false
      t.decimal :total, precision: 10, scale:2, default: 0.00, null: false
      t.integer	:status, null: false, default: 1
      t.timestamps null: false
    end
  end
end
