Design of data Table for third Party Authorization Login

items are separated from front and rear!

at present, you want to access 4 login of Weibo, login of Alipay, login of qq, login of Wechat.

first question: should data tables be designed with four tables or one table with an app_type field! Specify which type belongs to which third party according to app_type!

second question: does the third party that needs to show the binding in the user information need to add a field such as is_bind_weibo to the user table or get whether to bind a third-party platform after the associated query?


Design a table with a field to indicate which three parties each represent.
if you don't query very frequently, it feels like a related query.


I saw a question about wp yesterday, and I saw that the design might be better.

Design a user child table, which is stored in the form of user_id+key= > value.

Chestnut: user_metadata

< table > < thead > < tr > < th > id < / th > < th > user_id < / th > < th > key < / th > < th > value < / th > < / tr > < / thead > < tbody > < tr > < td > 1 < / td > < td > 1 < / td > < td > qq_openid < / td > < td > dubxynibddvn < / td > < / tr > < tr > < td > 2 < / td > < td > 1 < / td > < td > wechat_openid < / td > < td > cybxunjbct < / td > < / tr > < tr > < td > 3 < / td > < td > 1 < / td > < td > sina_openid < / td > < td > ginxyninfdx < / td > < / tr > < / tbody > < / table >

I suggest creating a new data table separately, such as Wechat's. If you have an official account, Mini Program about users, you must use unionid to bind users. In addition, if you want to send template messages, you need to use openid

.
Menu