Picking the best primary key + numbering system

前端 未结 13 1631
盖世英雄少女心
盖世英雄少女心 2020-12-02 14:50

We are trying to come up with a numbering system for the asset system that we are creating, there has been a few heated discussions on this topic in the office so I decided

13条回答
  •  醉梦人生
    2020-12-02 15:33

    Don't put meaning into your PK fields unless...

    • It is 100% completely impossible that the value will never change and that

    • No two people would ever reasonably
      argue about which value should be
      used for a particular row.

    Go with option one and format the value in the app to look like option two or three when it is displayed.

提交回复
热议问题