Lookup Tables Best Practices: DB Tables… or Enumerations

后端 未结 9 1828
忘掉有多难
忘掉有多难 2020-12-07 09:27

If we have to store the available positions at a company (i.e. Manager, Team Lead, ... etc). What are the best practices for storing it? I have two opinions with comments...

9条回答
  •  伪装坚强ぢ
    2020-12-07 09:33

    Lookups, Lookups, Lookups (insert monkey-dancing video here)

    My personal "best practice" is to have everything in the database. Positions in a company is definitely a lookup table.

    The same goes for translations, which may be a bit trickier, but generally a view definition joining the table with a translation table is a good start.

    Besides, if the Position is only an int value, and your app is single-language, you can add the position titles directly to the database.

提交回复
热议问题