How should I structure my settings table with MySQL?

后端 未结 4 1340
我在风中等你
我在风中等你 2021-02-18 12:35

What\'s the best way to structure a MySQL table for storing admin settings?

Like this?

Setting _|_ Value
setting1 |   a
setting2 |   b
setting3 |   c
set         


        
4条回答
  •  孤独总比滥情好
    2021-02-18 13:10

    Consider the first option (Setting, Value) as columns. But also consider adding additional, meta columns as well, such as Description (would come in handy if you have alot of ambiguous settings), PreviousValue, LastUpdated, UpdatedBy, etc.

提交回复
热议问题