Is this bad design ?
From: ben brugman <ben_at_niethier.nl>
Date: Mon, 8 Mar 2004 17:11:32 +0100
Message-ID: <404c9b34$0$281$4d4ebb8e_at_read.news.nl.uu.net>
Mother table.
fields:
mother_id
still_valid boolean
etc_fields
Date: Mon, 8 Mar 2004 17:11:32 +0100
Message-ID: <404c9b34$0$281$4d4ebb8e_at_read.news.nl.uu.net>
Mother table.
fields:
mother_id
still_valid boolean
etc_fields
Child table
The child.still_valid field always contains a true, because only mothers
withs are still_valid can have children, to enforce this; a relation is
defined on the fields mother_id and still_valid.
fields:
mother_id
still_valid boolean
more_fields
(A child can not exist without its mother).
Because a field in the child table always has the same value, I think
there is something wrong. But if this field is taken away a mother might
become un_valid by another action.
Is this bad design ?
what is a alternative ?
(As I understand constraints should be implemented in the RDBMS and
not in the code).
ben brugman Received on Mon Mar 08 2004 - 17:11:32 CET