[Pdx-pm] Eliminating circular table relations.

Michael G Schwern schwern at gmail.com
Wed Jan 31 13:22:18 PST 2007


Adriano Ferreira wrote:
>> While this ensures each sub-type row has an account row, it allows an
>> account row to exist without a sub-type.  That's not allowed by the
>> business rules.  Each account has one sub-type row and for each
>> sub-type there is one account.
> 
> That means one additional common attribute may be some kind of
> account_type_id. This account_type_id in your case should live in a
> discriminator table with two rows: one for meat accounts and another
> for mushroom accounts. As this attribute will be required, there is no
> way to create an account that is other than meat or mushroom (unless
> you add a new type -- but you should know what you're doing in this
> case).

Could you write out that discriminator table long hand?  I'm a little hazy on how it would work and I'm having trouble finding examples.


More information about the Pdx-pm-list mailing list