akkounts/db/migrate/20240214115058_change_donation_amounts_and_currency.rb

10 lines
315 B
Ruby

class ChangeDonationAmountsAndCurrency < ActiveRecord::Migration[7.1]
def change
rename_column :donations, :amount_usd, :fiat_amount
add_column :donations, :fiat_currency, :string, default: "USD"
remove_column :donations, :amount_eur, :integer
Donation.update_all(fiat_currency: 'USD')
end
end