so ...

tbl_users (containing things that don't need to be shared)
-----
userid
displayName
archived
lastLoginDate
lastLoginLocation
joinDate
...

tbl_things_that_can_be_shared
-----
thingid
thing ("emailAddress", "phoneNumber", "birthday")


tbl_shared_things (standard join table)
-----
(pk) userid (fk to users.userid)
(pk) thingid (fk to things.thingid)
(pk) toShareWithUserID (fk to users.userid)
(if they are in this table, then they are shared, so no boolean is needed)

tbl_user_things
-----
(pk) userid (fk to users.userid)
(pk) thingid (fk to things.thingid)
thingContents (the actual contents of the things for the user in
question, like 'b...@example.com', '8885551212', '01/01/1980')

Then make a view of the
tbl_users->tbl_things_that_can_be_shared->tbl_user_things relationships
to approximate a more traditional users table for easier querying.

?


On 3/20/2014 8:56 PM, Michael van Leest wrote:
> 
> I would build it like this:
> 
> - tbl_users (userID etc)
> - tbl_user_things (thing id so you can add extra "things" without changing
> the DB)
> - tbl_user_join_thing (userID, thingID, setting (boolean 1/0) and a
> optional toShareWithUserID)
> 
> Hope this helps


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:358059
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to