Paul E. G. Lynch
2009-Apr-16 22:08 UTC
Does rake db:migrate protect against concurrent use?
If two people go to the same rails application (same directory) and both run "rake db:migrate" to update the database with a set of migrations (the same ones) at the same time, is it likely that bad things will happen to the data, or will db:migrate do something to prevent the same migration from being run by more than one (simultaneous) process? Thanks, --Paul --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> If two people go to the same rails application (same directory) and > both run "rake db:migrate" to update the database with a set of > migrations (the same ones) at the same time, is it likely that bad > things will happen to the data, or will db:migrate do something to > prevent the same migration from being run by more than one > (simultaneous) process?rake db:migrate is only tuned for one development workstation. Are you implying your developers don''t have individual databases? In my experience running various rake commands accidentally at the same time, one batch will "win", and the other will cough up a zillion errors and expire gracelessly... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Depending on your DB, it may support transactional migrations (as of Rails 2.2). That should ensure that only one set of changes go through. Haven''t ever tried it, but it should probably work. --Matt Jones On Apr 16, 6:47 pm, "Phlip" <phlip2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > If two people go to the same rails application (same directory) and > > both run "rake db:migrate" to update the database with a set of > > migrations (the same ones) at the same time, is it likely that bad > > things will happen to the data, or will db:migrate do something to > > prevent the same migration from being run by more than one > > (simultaneous) process? > > rake db:migrate is only tuned for one development workstation. > > Are you implying your developers don''t have individual databases? > > In my experience running various rake commands accidentally at the same > time, one batch will "win", and the other will cough up a zillion errors and > expire gracelessly...--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---