Sha256: d1a8e00528b39d043cb2776c87246eaa59e033914b8973bc10c868c81292e09f

Contents?: true

Size: 820 Bytes

Versions: 5

Compression:

Stored size: 820 Bytes

Contents

namespace :db do

  desc 'Warns if there are pending migrations'
  task :warn_if_pending_migrations => :environment do
    if defined? ActiveRecord
      all_migrations = ActiveRecord::Migrator.migrations('db/migrate')
      pending_migrations = ActiveRecord::Migrator.new(:up, all_migrations).pending_migrations

      if pending_migrations.any?
        puts ''
        puts '======================================================='
        puts "You have #{ pending_migrations.size } pending migrations:"
        pending_migrations.each do |pending_migration|
          puts '  %4d %s' % [pending_migration.version, pending_migration.name]
        end
        puts 'Run cap <stage> deploy:migrations'
        puts '======================================================='
        puts ''
      end

    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
katapult-0.5.0 lib/generators/katapult/basics/templates/lib/tasks/pending_migrations.rake
katapult-0.4.1 lib/generators/katapult/basics/templates/lib/tasks/pending_migrations.rake
katapult-0.4.0 lib/generators/katapult/basics/templates/lib/tasks/pending_migrations.rake
katapult-0.3.0 lib/generators/katapult/basics/templates/lib/tasks/pending_migrations.rake
katapult-0.2.0 lib/generators/katapult/basics/templates/lib/tasks/pending_migrations.rake