1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-05 05:25:24 +02:00
Maybe/db/migrate/20250110012347_category_classification.rb

18 lines
546 B
Ruby
Raw Normal View History

class CategoryClassification < ActiveRecord::Migration[7.2]
def change
add_column :categories, :classification, :string, null: false, default: "expense"
add_column :categories, :lucide_icon, :string
# Attempt to update existing user categories that are likely to be income
reversible do |dir|
dir.up do
execute <<-SQL
UPDATE categories
SET classification = 'income'
WHERE lower(name) in ('income', 'incomes', 'other income', 'other incomes');
SQL
end
end
end
end