When having an identity column is not a good idea?

后端 未结 8 427
深忆病人
深忆病人 2021-01-12 04:06

In tables where you need only 1 column as the key, and values in that column can be integers, when you shouldn\'t use an identity field?

To the contrary, in

8条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-12 04:57

    I suppose if you are creating a many-to-many linking table, where both fields are foreign keys, you don't need an identity field.

    Nowadays I imagine that most ORMs expect there to be an identity field in every table. In general, it is a good practice to provide one.

提交回复
热议问题