Class: Findbug::Generators::UpgradeGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Findbug::Generators::UpgradeGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/findbug/upgrade_generator.rb
Overview
UpgradeGenerator creates any missing migrations for existing Findbug installations.
Usage:
rails generate findbug:upgrade
This is safe to run multiple times — it only creates migrations that don’t already exist. Use this when upgrading Findbug to a new version that adds new database tables.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
24 25 26 |
# File 'lib/generators/findbug/upgrade_generator.rb', line 24 def self.next_migration_number(dirname) ActiveRecord::Generators::Base.next_migration_number(dirname) end |
Instance Method Details
#create_missing_migrations ⇒ Object
28 29 30 31 32 33 |
# File 'lib/generators/findbug/upgrade_generator.rb', line 28 def create_missing_migrations create_migration_if_missing( "create_findbug_alert_channels.rb", "db/migrate/create_findbug_alert_channels.rb" ) end |
#display_next_steps ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/generators/findbug/upgrade_generator.rb', line 35 def display_next_steps return unless behavior == :invoke say "" say "=================================================================", :green say " Findbug upgrade complete!", :green say "=================================================================", :green say "" say "Next steps:" say "" say " 1. Run migrations: rails db:migrate" say "" say " 2. Configure alerts via the dashboard:" say " http://localhost:3000/findbug/alerts" say "" say " 3. (Multi-tenant apps) Add to apartment.rb excluded_models:" say " Findbug::AlertChannel" say "" end |