I would like the users be able to create their accounts (which stores the login and password information - Accounts table) and once the email is verified, they have the option of creating their own person record (which stores the other information such as first name, ... - People table). I also want the users (Account holders) be able to create person records other than themself. So when creating their own person record, users have the option of accepting a person record that was created by someone else instead of creating on their own or even be able to download a profile from other social networking sites and create the person record.
Each of these account holders also have several messages from other users and other social networking contents like blogs, ... My question is whether to associate these messages, blogs, employments,... to the account_id or person_id?
================================================================================= UPDATE: Alright, I guess I was not very creative in crafting my question. In a simple app, I could create just on USERS table and store all the login info as well as the user info such as first_name, ... and associate the messages, and other stuff with the user_id.
But as I want the users be able to create many Person records (not only for themself as well as others, which may include info about the users that have not yet created their accounts) I am thinking of separating the login info into ACCOUNTS table (or call it USERS table) and profile info into PEOPLE table. Each account holder will have only one Person record (their own and this is the info that identifies them to the world, as login info is just for system authentication only). Lets say YOU have created an account as well as your person record, and saw person Bill Gates and wanted to send message to him, we have two scenarios:
(1) Bill Gates person record is not claimed by any account holder as their own person
(2) Bill Gates person record has an associated account holder
In scenario (1) the system won't even let you send a message as there is no account holder that could check the messages and in scenario (2) should I save the BillGates person_id in the receivers_id of the MESSAGES table or BillGates.account.id ?
Same applies to all the other content types, like blogs, photos, ...
Lets see, if I can put together the table relationships:
ACCOUNTS
id
login
password
person_id (account holders personal record)
PEOPLE
id
first_name
....
creater_id (current_account().person.id or just the current_account().id ?)
updater_id (current_account().person.id or just the current_account().id ?)
MESSAGES
sender_id (current_account().person.id or just the current_account().id ?)
receiver_id (person.id or person.account.id ?)
subject
body
BLOGS
id
title
body
author_id (current_account().person.id or just the current_account().id ?)
I hope I made my point. If not let me know, I will try to think of some other examples.