desc "Migrate the database through scripts in db/migrate. Target specific version with VERSION=x. You can use decimal migration numbers like 002.5" task :migrate_with_decimals => :environment do ActiveRecord::Migrator.migrate("db/migrate/", ENV["VERSION"] ? ENV["VERSION"].to_f : nil) Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby end