load migrate file and load

Dir[Rails.root.join('db','migrate','*.rb')].each{|file|require file}

Dir[File.dirname(__FILE__) + '/../lib/*.rb'].each do |file| 
  require File.basename(file, File.extname(file))
end


rails console
>> require "db/migrate/20090408054532_add_foos.rb"
>> AddFoos.up


script/runner 'require("db/migrate/20090408054532_add_foos.rb").first.constantize.up'


rake db:migrate:up VERSION=20090408054532

你可能感兴趣的:(File)