class AddPDeviseToPriceLineBlocks < ActiveRecord::Migration[6.0]
  def change
    add_column :price_line_blocks, :p_devise_id, :integer, :default => 1
    add_column :price_line_blocks, :cc_devise_rate, :decimal,   :precision => 14,   :scale => 7, :default => 1.0
    add_column :price_line_blocks, :ac_devise_rate, :decimal,   :precision => 14,   :scale => 7
    
    
    add_column :price_line_blocks, :local_amount_ttc, :integer,   :precision => 14,   :scale => 7
  
  
    add_column :price_lines, :cc_p_devise_id, :integer
    add_column :price_lines, :ac_p_devise_id, :integer
    
    
    add_column :price_lines, :cc_devise_rate, :decimal,   :precision => 14,   :scale => 7, :default => 1.0
    add_column :price_lines, :ac_devise_rate, :decimal,   :precision => 14,   :scale => 7
    
    add_column :price_lines, :cc_local_tot_amount_ht, :decimal,   :precision => 14,   :scale => 2
    add_column :price_lines, :ac_local_tot_amount_ht, :decimal,   :precision => 14,   :scale => 2
    
    
    PriceLine.update_all(:cc_p_devise_id => 1)
  end
end
