[thelist] DB Schema Design
Ian Anderson
ian at zstudio.co.uk
Sun May 7 09:43:15 CDT 2006
Hershel Robinson wrote:
> The plan that the other designer has is to use one table called statuses
> with three fields: id, name, class. This one table will be used for all
> statuses in the system. The name field will be the name of the status
> (on hold, active, shipped, factory, etc.) and the class field will hold
> for what type of object this status is relevant. So 'on hold' and
> 'active' might be relevant for products and 'shipped' and 'factory'
> might be relevant for orders.
Eeyuch... I'm afraid I think the single statuses table is misguided. I
think you can have a common status table where you have a consistent set
of values for each class of entity to which it relates, but you don't.
Because you're acknowledging that - for instance - customers can't be
shipped, I think you've basically answered your own question. You need
different status tables for each class of entity.
Also, I think you have to ask: if you have separate tables with entities
so similar that they share a single set of statuses, why are they in
separate tables?
Hope this helps
Cheers
Ian
--
zStudio - Web development and accessibility
- http://zStudio.co.uk
Snippetz.net - Your personal, private code library
- http://snippetz.net
More information about the thelist
mailing list