class CreatePTankStocks < ActiveRecord::Migration[6.0]
  def change
    create_table :p_tank_stocks do |t|
      t.datetime     :ok_at
      t.boolean      :enabled,   :default => false
      t.references   :p_brut_product,   index: true
      t.decimal      :volume,   :precision => 14,   :scale => 2
      t.decimal      :price,   :precision => 14,   :scale => 2
      t.references   :p_tank,   index: true
      t.string       :stock_type
      t.decimal      :volume_abs,   :precision => 14,   :scale => 2
      t.decimal      :volume_restant,   :precision => 14,   :scale => 2

      t.timestamps
    end
  end
end
