mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
- Add institution name & domain, to allow fetching logos when no provider is configured - Add free-form textarea for storing misc. notes (eg. sort codes, account numbers) - Update account settings form to support these new fields
13 lines
592 B
Ruby
13 lines
592 B
Ruby
class AddInstitutionFieldsToAccounts < ActiveRecord::Migration[7.2]
|
|
def change
|
|
add_column :accounts, :institution_name, :string
|
|
add_column :accounts, :institution_domain, :string
|
|
add_column :accounts, :notes, :text
|
|
|
|
# Touch all accounts to invalidate cached queries that depend on accounts.maximum(:updated_at)
|
|
# Without this, the following error would occur post-update and prevent page loads:
|
|
# "undefined method 'institution_domain' for an instance of BalanceSheet::AccountTotals::AccountRow"
|
|
Account.in_batches.update_all(updated_at: Time.current)
|
|
end
|
|
end
|