class CreatePSheetLineStocks < ActiveRecord::Migration[6.0]
  def change
    create_table :p_sheet_line_stocks do |t|
      t.references   :p_sheet_line,   index: true
      t.references   :p_brut_product,   index: true
      t.references   :p_product_brut_stock,   index: true
      t.boolean      :ok,   :default => false
      t.datetime     :ok_at
      t.decimal      :qte,   :precision => 14,   :scale => 2
      t.decimal      :qte_ok,   :precision => 14,   :scale => 2
      t.decimal      :price,   :precision => 14,   :scale => 2
      t.decimal      :price_ok,   :precision => 14,   :scale => 2
      t.boolean      :lock,   :default => false
      t.boolean      :decr,   :default => false

      t.timestamps
    end
  end
end
