[thesite] database: Attributes table

Warden, Matt mwarden at mattwarden.com
Sat Aug 4 14:29:09 CDT 2001


On Aug 3, rudy had something to say about Re: [thesite] database:...

>> (a) add a column (and maybe a separate lookup table)
>> speciying attribute type (what it applies to)
>> (b) add a separate table for these attributes
>
>looks like you are talking about a generic code table

Pretty much, but I'd only be using the attribute_type table as a
reference... so people poking in the db don't have to look in the code. To
me these two are equivalent:

memberattrtype = "member"
<cfquery ...>
select foo
from attribute
where attrtype='#memberattrtype#'
</cfquery

and

memberattrtype = 1
<cfquery ...>
select foo
from attribute
where attrtype=#memberattrtype#
</cfquery>

accompanied by the lookup table in the db:

+-----------------------+
|      ATTRIBUTETYPE    |
+-----------------------+
| attrid | attrtypedesc |
+=======================+
|   1    |  member      |
|   2    |  user        |
|   3    |  content     |
...
+-----------------------+


Truthfully, I just wanted to make some ASCII art.


The point is that I wouldn't be using the ATTRIBUTETYPE table for anything
in the code. It's just a reference. Maybe a waste of space, I dunno, but
it sure puts more meaning into 1, 2, 3.

>if you think this would make a good article, i'll add it to the backlog
>;o)

You betcha.

>anyhow, the point is, if you see yourself declaring code tables all over
>the place, you have to balance the complexity of the generic code table
>approach (it involves another join to resolve descriptions) against
>flexibility (one admin interface for any codes in the application, easy to
>add additional language support, etc.)

Ok, so now that you know it ain't gonna add any joins, what do you say?

I'm more or less looking towards evolt3.0 where one of the things that
will have to be fixed is copies of the member table for each subsite. I
assume that one way this could be fixed is to make one database for all
*eo sites. I don't want to wipe that out as a possibility because odd-ball
feo requires an extra table and column that doesn't exist in the weo
database. More principle than the effects of this addition alone. Ya know?

Not to spark an evolt3.0 discussion or anything.

/bow rudy



thanks,


--
mattwarden
mattwarden.com





More information about the thesite mailing list