I made a friendly alias to rake db:migrate VERSION=0 (got tired of
writing it all the time)
Feel free to use it.
# add alias to "rake db:migrate VERSION=0"
# that can be called without extra parameters
namespace :db do
namespace :migrate do
desc "Alias for db:migrate VERSION=0"
task :down => :environment do
puts "migrates down to version 0 of database"
ActiveRecord::Migrator.migrate("db/migrate/", 0)
Rake::Task["db:schema:dump"].invoke if
ActiveRecord::Base.schema_format == :ruby
end
end
end
I vaguely recall that I have read that it''s possible to put snippets
out as pasties, so that everybody can use it as a sake task.
Could someone please explain me how?
Thanks"
/Jesper
blog: www.justaddwater.dk
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---