mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-26 00:29:40 +02:00
* adds a smoke test in the CI for the migration * add back money rails gem * really remove money-rails * update the migration to remove add_monetize
14 lines
420 B
Ruby
14 lines
420 B
Ruby
class ReplaceMoneyField < ActiveRecord::Migration[7.2]
|
|
def change
|
|
add_column :accounts, :balance_cents
|
|
change_column :accounts, :balance_cents, :integer, limit: 8
|
|
|
|
Account.reset_column_information
|
|
|
|
Account.find_each do |account|
|
|
account.update_columns(balance_cents: Money.from_amount(account.balance_in_database, account.currency).cents)
|
|
end
|
|
|
|
remove_column :accounts, :balance
|
|
end
|
|
end
|