Is it possible to make Migrations occur in a single transaction, so that if the rake fails, it doesn''t leave the database in a broken state, with half the changes made, and the other half incomplete? Obviously, this depends on the database itself supporting transactions, but I''m using Postgres. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Stuart Grimshaw wrote:> Is it possible to make Migrations occur in a single transaction, so > that if the rake fails, it doesn''t leave the database in a broken > state, with half the changes made, and the other half incomplete? > > Obviously, this depends on the database itself supporting transactions, > but I''m using Postgres. > > > > >I wrap my migrations in a transaction using postgresql, and it seems to work fine. -- Jim Morris, http://blog.wolfman.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Me too. But you need a database backend that will transact DDL changes. Not all do. Postgres for sure does, and now I don''t have any half-made transactions anymore. I can give you more details if needed. Bye, Guy. On 10/23/06, Jim Morris <ml-1xQvGnpSPfAAvxtiuMwx3w@public.gmane.org> wrote:> > Stuart Grimshaw wrote: > > Is it possible to make Migrations occur in a single transaction, so > > that if the rake fails, it doesn''t leave the database in a broken > > state, with half the changes made, and the other half incomplete? > > > > Obviously, this depends on the database itself supporting transactions, > > but I''m using Postgres. > > > > > > > > > > > I wrap my migrations in a transaction using postgresql, and it seems to work fine. > > -- > Jim Morris, http://blog.wolfman.com > > > >-- Family management on rails: http://www.famundo.com - coming soon! My development related blog: http://devblog.famundo.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Stuart Grimshaw wrote:> Is it possible to make Migrations occur in a single transaction, so that if > the rake fails, it doesn''t leave the database in a broken state, with half > the changes made, and the other half incomplete? > > Obviously, this depends on the database itself supporting transactions, but > I''m using Postgres. >The easiest way for you is to use transactional_migrations plugin. Thus you won''t need to put explicit BEGIN and COMMIT DDL statements in migrations. http://www.redhillconsulting.com.au/rails_plugins.html#transactional_migrations -- Sava Chankov --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hello: You wrote in another thread, now outdated, about a way for getting decimal support for ActiveRecord, in version 1.1.6. Is there a way of having that code? Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Stuart Grimshaw
2006-Nov-07 23:46 UTC
Re: ActiveRecord migrations in a single transaction?
Thanks Sava, this is what I went for in the end ... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---