Files
sure/db/migrate/20251116010421_add_institution_fields_to_accounts.rb
Matthew Kilpatrick 68864b1fdb Add instituion details & notes to Account model (#481)
- 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
2025-12-24 00:59:50 +01:00

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