Modelling Problem

From: Diggers <simonrigby_uk_at_hotmail.com>
Date: 20 Jan 2006 12:16:49 -0800
Message-ID: <1137788209.189272.82870_at_g49g2000cwa.googlegroups.com>



Sorry for the non descriptive title but I wasn't really sure how to describe it.

I have a scenario where I have the following tables.

Projects (PK ProjectID, FK ProposalID -> Proposals) Proposals (PK ProposalID)

As you can see a project can have a proposal related to it.

Now I have a Comment table that is self referencing (representing a threaded discussion group).

The problem I have is that I need to encode in the comment, the project or proposal that the comment relates to. But my problem is it can be a project or a proposal. How can I design this in such a way that the comment can relate to either a project or a proposal.

Many Thanks in advance.

Oh, and I am a great advocate on design patterns in software, and I notice there is a wealth of material on Data Model Patterns on the web. If anyone has some particular resources that they deem to be of good quality (books or websites) I'd be interested to hear your recommendations. Nothing like local knowledge.

Cheers

Simon Received on Fri Jan 20 2006 - 21:16:49 CET

Original text of this message