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
load migrate file and load
最新推荐文章于 2023-09-15 20:28:41 发布