I want to save the user preference for external login options in SQL Database. Users can select multiple options and custom login is default. The options are fixed as follows:
Currently I have a Preference
table in which I am saving other preferences. So my question is how can I save these options in Preference
table.
Means:
Should I save this in single column, how?
Should I have to create a new table ( LoginOptions
) and linked it with Preference
table in many to one relationship.
Or any other better option?
You are proposing a many-to-many relationship between users and their login options. Your best option is to have a LoginOption
table and create a many-to-many relationship between that and Users
(or Preference
) table.
Option 1 is essentially creating a many-to-many relationship with a single field. It's more effort, in the long run, with less pay back compared what I have outlined above.
Alternatives are to:
Preference
record for each login option. Again you are will need to put effort into these "short cuts", but won't reap the same benefits are a proper many-to-many table relationship.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.