Ruby on Rails
Tuesday, April 3, 2012
I do this in my bashrc:
alias migrate='bundle exec rake db:migrate; RAILS_ENV=test bundle exec rake db:migrate;'
Not sure of the syntax but you get the idea. I don't use rake or rake spec, and prefer running a guard/spork combo. Hence whenever I want to run a migration, I just run 'migrate' and that's it.
Dheeraj Kumar
On Wednesday 4 April 2012 at 3:13 AM, Frederick Cheung wrote:
On Apr 3, 9:43 pm, "@1337807" <jonanscheff...@gmail.com> wrote:Why is it necessary for me to run 'rake db:test:prepare' when I generate anew model?it shouldn't be - if you run rake (which defaults to running rake testor rake spec depending in your setup) it runs rake db:test:prepare foryouShouldn't the 'rake db:migrate' also affect the test database? Why wouldanyone want to preserve the (broken) state of their test database?In general it is easier to clone the test database from thedevelopment database (via schema.rb) than try and replay migrations onboth, particularly for an older application with logs of migrationsFred--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@googlegroups.com.To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment