Can I create a table without a primary key?
I want to create a t开发者_高级运维able without a primar key:
users_models
user_id model_id
I have a users table, but the model_id value is actually going to come from a enumeration that I have in my code.
So I don't need a primary key on this table, can I in my migration tell it so it doesn't create one?
At your migration change :
create_table :users, {:id => false, :force => true}
精彩评论