Persons is the user table...
Relations is the relation group and it belongs to person_id

I then need a table that lists all persons that the RelationOwner has
placed into it which consists of person_id(owner) relation_id
person_id(person in the relationship)

CREATE TABLE persons {
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
name VARCHAR (20)
}

CREATE TABLE relations {
id INT UNSIGNED,
person_id INT UNSIGNED
PRIMARY KEY(id, person_id)
}

CREATE TABLE persons_relations_persons {
relation_id INT UNSIGNED,
persona_id INT UNSIGNED
personb_id INT UNSIGNED
PRIMARY KEY(relation_id, persona_id, personb_id)
}

Thoughts on best practice?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to