Is there a way to make rake halt execution when invoking the Rails migration tasks? Right now it runs straight through attempting each one. What I really want is to attempt drop, then attempt create, and if either of those are successful, then run migrate, then seed if that is successful, stop and display an error if any failures.
I've tried invoke on each task, testing the result but, that doesn't seem to be right either.
Thanks.
task :fresh_start => [
'db:drop',
'db:create',
'db:migrate',
'db:seed'] do
end
By default Rake will stop at the first exception raised. For instance the following will never print "That".
task :this do
puts "This"
raise "Fail!"
end
task :that do
puts "That"
end
task :default => [:this,:that]
Isn't that what you'd like ?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With