|
|
|
|
|
by lmm
2101 days ago
|
|
> Wouldn't you just have your third party tables (each with their own idiosyncrasies) and in your user table you'd have login_type and login_id columns? You know which table to hit by type using the id? You can do that but it's a bodge. E.g. you won't be able to have the foreign key constraints you'd normally have on that login_id column. And good luck writing a query that actually does something differently for each case - you'd have to do something like multiple left joins and there's no way to check you've handled all the cases and not done one of them twice. |
|
As for how you would model it in the application, in this case you can just normalize across all the possible columns and have the orm build out your mapped object.