开发者

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}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜