parent-child relation with two children...

From: Daniel Pitts <newsgroup.spamfilter_at_virtualinfinity.net>
Date: Thu, 31 Jul 2008 13:21:48 -0700
Message-ID: <48921e8e$0$3365$7836cce5_at_newsrazor.net>



I have something like:
entity (id, live_version_id NULL, preview_version_id NULL) version (id, parent_entity_id)

where version.parent_entity_id must be a valid entity.id, and that entity must have the version.id in either live/preview version_id. Is this a common set up? Does it make sense? Is there a way to express this requirement at the DB level (I'm specifically using MySQL, but in general I'd like to know)

Or, did I model my data in a bad way?

Thanks,
Daniel.

-- 
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
Received on Thu Jul 31 2008 - 22:21:48 CEST

Original text of this message