Sha256: 90d6ecee89187d63bf0fc7f0e446b8c26066a7223729ad53906ac06055ea130b

Contents?: true

Size: 568 Bytes

Versions: 3

Compression:

Stored size: 568 Bytes

Contents

namespace :db do
  desc "Creates a new migration file with the specified name"
  task :new_migration, :name, :options do |t, args|
    name = args[:name] || ENV['name']
    options = args[:options] || ENV['options']
    
    unless name
      puts "Error: must provide name of migration to generate."
      puts "For example: rake #{t.name} name=add_field_to_form"
      abort
    end
    
    if options
      StandaloneMigrationsNew::Generator.migration name, options.gsub('/', ' ')
    else
      StandaloneMigrationsNew::Generator.migration name
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
standalone_migrations_new-7.1.2 lib/standalone_migrations_new/tasks/db/new_migration.rake
standalone_migrations_new-7.1.1 lib/standalone_migrations_new/tasks/db/new_migration.rake
standalone_migrations_new-7.1.0 lib/standalone_migrations_new/tasks/db/new_migration.rake