Hi there, I''m using Migrations to define my db schema. However, I have a table that mustn''t have an ID. Migrations always add them automatically; is there any way to tell the "create_table" that I don¡t need the "id" column? Thanks. -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
create_table :images_tags, :id => false do |table| table.column :image_id, :integer table.column :tag_id, :integer end Damaris Fuentes wrote:> Hi there, > I''m using Migrations to define my db schema. However, I have a table > that mustn''t have an ID. Migrations always add them automatically; is > there any way to tell the "create_table" that I don¡t need the "id" > column? > > Thanks.-- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Nathan Esquenazi wrote:> create_table :images_tags, :id => false do |table| > table.column :image_id, :integer > table.column :tag_id, :integer > endThanks!!! And, btw, what if I want an id but not of "integer" type? Should I do something like create_table :whatever, :id => false, :primary_key => my_id do |t| table.column :my_id, :decimal ... ? Thanks again. -- 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 -~----------~----~----~----~------~----~------~--~---