Class: ChronoForge::UpgradeGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
ActiveRecord::Generators::Migration, Generators::MigrationActions
Defined in:
lib/generators/chrono_forge/upgrade/upgrade_generator.rb

Overview

Brings an existing ChronoForge installation up to the current schema by copying any migrations the application does not already have. Applications created with ‘chrono_forge:install` on the current version already have everything; older installs pick up the additive migrations (currently the chrono_forge_workflows [state, completed_at] index).

rails generate chrono_forge:upgrade
rails db:migrate

Constant Summary

Constants included from Generators::MigrationActions

Generators::MigrationActions::MIGRATIONS

Instance Method Summary collapse

Methods included from Generators::MigrationActions

#chrono_forge_migration_exists?, #copy_chrono_forge_migrations

Instance Method Details

#startObject



21
22
23
24
25
26
# File 'lib/generators/chrono_forge/upgrade/upgrade_generator.rb', line 21

def start
  copy_chrono_forge_migrations
rescue => err
  say "#{err.class}: #{err}\n#{err.backtrace.join("\n")}", :red
  exit 1
end