20171211222709_change_columns_in_sellers_commissions.rb 623 B

1234567891011
  1. class ChangeColumnsInSellersCommissions < ActiveRecord::Migration
  2. def change
  3. if table_exists? :sellerscommissions
  4. remove_column :sellerscommissions, :num_products
  5. add_column :sellerscommissions, :total_sold_cash, :decimal, precision: 10, scale: 2, default: 0.0
  6. add_column :sellerscommissions, :total_sold_credits_apartments, :decimal, precision: 10, scale: 2, default: 0.0
  7. add_column :sellerscommissions, :income_by_cash, :decimal, precision: 10, scale: 2, default: 0.0
  8. add_column :sellerscommissions, :income_by_reserved_and_credits, :decimal, precision: 10, scale: 2, default: 0.0
  9. end
  10. end
  11. end