开发者

Can I create a table without a primary key?

开发者 https://www.devze.com 2023-02-24 23:56 出处:网络
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

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

精彩评论

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