How to store site wide settings in a database?

前端 未结 9 2868
时光说笑
时光说笑 2021-02-19 10:08

I\'m debating three different approaches to to storing sitewide settings for a web application.

A key/value pair lookup table, each key represents a setting.

    <
9条回答
  •  闹比i
    闹比i (楼主)
    2021-02-19 10:30

    Go with #1. If you want constraints based on simple types, then rather than having a simple string as a value, add a date and number field as well. The individual properties will "know" what value they want. No reason to get all meta about it.

提交回复
热议问题