Class: Organizations::Generators::UpgradeGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Organizations::Generators::UpgradeGenerator
- Includes:
- ActiveRecord::Generators::Migration
- Defined in:
- lib/generators/organizations/upgrade/upgrade_generator.rb
Overview
Upgrades an existing organizations install (<= 0.4.x) to 0.5.0 ("Verified Joining"): new tables for domains, join codes, allowlist entries and join requests, plus provenance columns on memberships and metadata columns on invitations.
Fresh installs don't need this ā rails g organizations:install
already includes everything.
rails g organizations:upgrade
rails db:migrate
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dir) ⇒ Object
25 26 27 |
# File 'lib/generators/organizations/upgrade/upgrade_generator.rb', line 25 def self.next_migration_number(dir) ActiveRecord::Generators::Base.next_migration_number(dir) end |
Instance Method Details
#create_migration_file ⇒ Object
29 30 31 32 33 |
# File 'lib/generators/organizations/upgrade/upgrade_generator.rb', line 29 def create_migration_file migration_template "add_verified_joining_to_organizations.rb.erb", File.join(db_migrate_path, "add_verified_joining_to_organizations.rb"), migration_version: migration_version end |
#display_post_upgrade_message ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/generators/organizations/upgrade/upgrade_generator.rb', line 35 def say "\nā organizations verified-joining migration created.", :green say "\nNext steps:" say " 1. Run 'rails db:migrate'." say " 2. See the README's \"Verified joining\" section for the new API" say " (domains, join codes, allowlists, join requests)." end |