Looks like you are saying that Owner & Chronicle models hasMany domains. a Domain leaf can only have 1 owner & 1 chronicle. This creates a unique key that identifies a specific domain branch.
I think a lot depends on what other information you might want to have related to the domain, owner, chronicle relationship. If this is going to grow, then use a join table, and put this information in the join table. Do you want to know when this relationship was created? modified? do you want to do a softdelete to easily restore it? do you want a history of who has owned it in the past? Could there be links to other models at some point that would be related? If the relationship is going to be created once and not modified and static, I would probably keep it in the domain table. If it changes, including changing by adding another level to the domain, it might make it easier to keep this in the join table, and depending on how you expand and collapse the levels, you may not have to modify the join table, only the domain table. HTH. bill On 6/7/2012 7:35 PM, Michael Gaiser [via CakePHP] wrote: > So, I have a domain model that has a parent/child relationship with > itself going about 6 levels deep. Certain levels have some additional > data I need to store(owner_id, chronicle_id, etc) but these values are > only on the bottom most level. Is it better to have the domain table > have a owner_id and a chronicle_id column knowing they will be null > for all the levels except the bottom one, or should I have a join > table that will associate the domain model with the chronicle & owner > models? I can see some drawbacks to both options and the differences > to the use is not big enough to make it it own table. Any ideas? -- > 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 > [hidden email] </user/SendEmail.jtp?type=node&node=5708645&i=0> For > more options, visit this group at http://groups.google.com/group/cake-php > > > ------------------------------------------------------------------------ > If you reply to this email, your message will be added to the > discussion below: > http://cakephp.1045679.n5.nabble.com/Database-structure-question-tp5708645.html > > > To start a new topic under CakePHP, email > ml-node+s1045679n125572...@n5.nabble.com > To unsubscribe from CakePHP, click here > <http://cakephp.1045679.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1255722&code=YmlsbC5zdG9sdHpAYm9vc3RlcndlYnNvbHV0aW9ucy5jb218MTI1NTcyMnwtNTU0NTk2MTUy>. > NAML > <http://cakephp.1045679.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > > -- View this message in context: http://cakephp.1045679.n5.nabble.com/Database-structure-question-tp5708645p5708646.html Sent from the CakePHP mailing list archive at Nabble.com. -- 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php