class CreatePSheetLines < ActiveRecord::Migration[6.0]
  def change
    create_table :p_sheet_lines do |t|
      t.references :p_customer_sheet, index: true, foreign_key: true
      t.references :p_product, index: true, foreign_key: true
      t.references :p_tank, index: true, foreign_key: true
      t.decimal :qte
      t.decimal :price
      t.datetime :ok_at
      t.decimal :ok_qte
      t.decimal :ok_price
      t.decimal :ok_price_abs
      t.boolean :ok
      t.boolean :lock, :delfault => false
      t.boolean :externe, :default => false
      t.integer :externe_stock_id

      t.timestamps null: false
    end
  end
end
