class CreateLineStocks < ActiveRecord::Migration[6.0]
  def change
    create_table :line_stocks do |t|
      t.references :p_product_ref, foreign_key: true
      t.text :description
      t.decimal :qte,   :precision => 14,   :scale => 2
      t.decimal :qte_available,   :precision => 14,   :scale => 2
      t.decimal :qte_used,   :precision => 14,   :scale => 2
      t.decimal :price_ht,   :precision => 14,   :scale => 2
      t.integer :price_line_block_id
      t.integer :price_line_id
      t.string :stockable_type
      t.integer :stockable_id
      t.datetime :date
      
      t.timestamps
    end
  end
end
