2010/11/12 Mirek Zvolský <[email protected]>: > That's not the case of > http://zvolsky.alwaysdata.net/crm2.jpg
DISCLAIMER: I'm not experienced with large-scale database designs. Now that I've gotten that out of the way... What's the meaning of 'created_by' in this set-up? If it's meant to be taken as 'record created by user' than I don't see any reason why this 'user' must be in the 'person' table. Person as a concept is not the same as the system user, and hence it's more logical to have a separate table for system users that may or may not be a person in the 'person' sense, but is definitely a 'user' that can create records. Person -> can belong to -> Company Person -> is also a -> User User -> can create a -> Person (that is not necessarily the same person as the user) User -> can create a -> Company So we have this: Person.created_by -> User.id (User that created this person) Person.user_id -> User.id (in plain English: has an account on this system) Company.created_by -> User.id In other words, we make a distinction between a real-world person, and a system account. Note that I'm not talking about how DAL works. I'm talking about how the data is modelled in this particular case. -- Branko Vukelić [email protected] [email protected] Check out my blog: http://www.brankovukelic.com/ Check out my portfolio: http://www.flickr.com/photos/foxbunny/ Registered Linux user #438078 (http://counter.li.org/) I hang out on identi.ca: http://identi.ca/foxbunny Gimp Brushmakers Guild http://bit.ly/gbg-group

