How to design table to store user settings?

184 views Asked by At

If its just for turning on and off a basic feature, this should be ok?

USER_SETTINGS
-Id
-UserId
-SettingId
-IsEnabled

The problem is some settings require various fields...this could work, but is there a better way to do this?

USER_SETTINGS
-Id
-UserId
-SettingId
-XMLSettings (XML data of settings)
1

There are 1 answers

0
Pavel Gatnar On

A. you can use nested table or object instead of XML on Oracle
B. you can create another table USER_SETTING_FIELD, which has foreign key to USER_SETTINGS
C. you can use simple string column with the format "field1:value1;field2:value2"
D. you can use extra SettingId for each field