Answer the question
In order to leave comments, you need to log in
How to design a database in this case?
We were given the task to introduce authentication on the site through social networks.
And everything would be fine, but I can not figure out the competent design of the database. Of course, I could code like a pimply fifth grader, but I write in Laravel, which means I need to do everything perfectly)
So, I have a User model. There is a users table. Here we store the name, ID, link to the profile picture, etc. To add the ability to link social accounts to ours, I plan to create a Connection model and a connections table with the following structure - id, user_id, service_id, uid (uid is a unique user ID in the connected social network). Also, I will create a Service model with a services table with the following structure - id, name. Here we will store a list of supported social networks (one might say, a reference table).
It seems to be normal, but not too intricate? Are there any shorter solutions to this problem? I would be very grateful!
UPD: I see a lot of such questions were asked on the Toaster recently, the cases are very similar, but the info is not exhaustive for me.
Answer the question
In order to leave comments, you need to log in
It seems to be normal, but not too intricate?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question