It’s best to put all the attributes in the same table.
If you start storing attribute names in a table, you save the metadata in your database, which interrupts the first normal form.
In addition, storing them in a single table simplifies your queries.
Would you prefer:
SELECT show_photos FROM User WHERE user_id = 1
or
SELECT up.show_photos FROM User u
LEFT JOIN UserPrivacy up USING(user_id)
WHERE u.user_id = 1
, 1- > N.
, , , - .
, . , , , . , PDO PHP, , ( ).
, user_id, id, Ruby, id. "user_id" , id, :
ON u.id = up.user_id
, :
ON u.user_id = up.user_id
:
USING(user_id)
" ". , .