Christopher J. Bottaro
2006-Sep-19 23:45 UTC
alternative to :decimal column type for migrations?
Hi, I''m reading Agile Web Development 2nd Edition and I''m following along by doing the sample application ''depot'' on my Linux machine. In one of their migrate scripts, they use the following line of code: add_column :products, :price, :decimal, :precision => 8, :scale => 2, :default => 0 They note in the book that :decimal won''t exist as a column type until Rails 1.2... which isn''t installed on my machine. What is the alternative, pre Rails 1.2 syntax for making a decimal column with precision 8 and scale 2? Thank you, -- C --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Michael Campbell
2006-Sep-20 01:15 UTC
Re: alternative to :decimal column type for migrations?
Drop tp SQL with execute. On 9/19/06, Christopher J. Bottaro <cjbottaro-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > I''m reading Agile Web Development 2nd Edition and I''m following along > by doing the sample application ''depot'' on my Linux machine. In one of > their migrate scripts, they use the following line of code: > add_column :products, :price, :decimal, :precision => 8, :scale => 2, > :default => 0 > > They note in the book that :decimal won''t exist as a column type until > Rails 1.2... which isn''t installed on my machine. What is the > alternative, pre Rails 1.2 syntax for making a decimal column with > precision 8 and scale 2? > > Thank you, > -- C > > > > >-- When a man says he approves of something in principle, it means he hasn''t the slightest intention of putting it into practice. -- Bismarck --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 9/20/06, Michael Campbell <michael.campbell-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Drop tp SQL with execute.Or upgrade to edge. Isak> > On 9/19/06, Christopher J. Bottaro <cjbottaro-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi, > > I''m reading Agile Web Development 2nd Edition and I''m following along > > by doing the sample application ''depot'' on my Linux machine. In one of > > their migrate scripts, they use the following line of code: > > add_column :products, :price, :decimal, :precision => 8, :scale => 2, > > :default => 0 > > > > They note in the book that :decimal won''t exist as a column type until > > Rails 1.2... which isn''t installed on my machine. What is the > > alternative, pre Rails 1.2 syntax for making a decimal column with > > precision 8 and scale 2? > > > > Thank you, > > -- C > > > > > > > > > > > > -- > When a man says he approves of something in principle, it means he > hasn''t the slightest intention of putting it into practice. -- > Bismarck > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Christopher J. Bottaro
2006-Sep-20 14:53 UTC
Re: alternative to :decimal column type for migrations?
Thanks, that worked... :) --C Michael Campbell wrote:> Drop tp SQL with execute. > > On 9/19/06, Christopher J. Bottaro <cjbottaro-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi, > > I''m reading Agile Web Development 2nd Edition and I''m following along > > by doing the sample application ''depot'' on my Linux machine. In one of > > their migrate scripts, they use the following line of code: > > add_column :products, :price, :decimal, :precision => 8, :scale => 2, > > :default => 0 > > > > They note in the book that :decimal won''t exist as a column type until > > Rails 1.2... which isn''t installed on my machine. What is the > > alternative, pre Rails 1.2 syntax for making a decimal column with > > precision 8 and scale 2? > > > > Thank you, > > -- C > > > > > > > > > > > > -- > When a man says he approves of something in principle, it means he > hasn''t the slightest intention of putting it into practice. -- > Bismarck--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---