Class: DeployPin::UpgradeGenerator

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

Overview

This generator is used to generate the migration file for upgrading db schema for 1.7 version support.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



11
12
13
14
# File 'lib/generators/deploy_pin/upgrade/upgrade_generator.rb', line 11

def self.next_migration_number(path)
  next_migration_number = current_migration_number(path) + 1
  ActiveRecord::Migration.next_migration_number(next_migration_number)
end

Instance Method Details

#copy_migrationsObject



16
17
18
# File 'lib/generators/deploy_pin/upgrade/upgrade_generator.rb', line 16

def copy_migrations
  migration_template 'upgrade_deploy_pins.rb', 'db/migrate/upgrade_deploy_pins.rb'
end