Hi, I can''t manage to get an unsigned int column with activerecord migration, I am using this definition: create_table :emails, :use_big_id => true do |t| t.column "destination", :string, :limit => 60, :null => false t.column "object", :string, :limit => 200, :null => false t.column "options", :string, :null => false t.column "created_at", :datetime, :null => false # FK t.column "user_id", :bigint, :unsigned => true, :null => false end isn''t the ":unsigned => true" supposed to create an unsigned column ? -- Posted via http://www.ruby-forum.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?hl=en -~----------~----~----~----~------~----~------~--~---
If you''re absolutely sure you''re going to be using a DBMS that supports it, you can use t.column :my_unsigned_int, :"int unsigned" to get what you want. If you need something other than the default limit on int there... t.column :my_unsigned_int, :"int(24) unsigned" should do the job. RSL On 4/9/07, Julien Ammous <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hi, > I can''t manage to get an unsigned int column with activerecord > migration, I am using this definition: > > create_table :emails, :use_big_id => true do |t| > t.column "destination", :string, :limit => 60, :null => false > t.column "object", :string, :limit => 200, :null => false > t.column "options", :string, :null => false > > t.column "created_at", :datetime, :null => false > > # FK > t.column "user_id", :bigint, :unsigned => true, :null => false > end > > > > isn''t the ":unsigned => true" supposed to create an unsigned column ? > > -- > Posted via http://www.ruby-forum.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?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for your answer, I will try that. I am using mysql and it won''t change on this project. -- Posted via http://www.ruby-forum.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?hl=en -~----------~----~----~----~------~----~------~--~---