Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: John Robinson
How totally funked up does your table design look?
7 posted on 06/19/2002 4:54:27 PM PDT by smith288
[ Post Reply | Private Reply | To 6 | View Replies ]


To: smith288
Not bad, really.

There is a comment table, a comment_user table with the comment-to-user associations, and a killfile table.


create table killfile (
    kf_rule_id int unsigned not null auto_increment primary key,
    kf_owner_uid mediumint unsigned not null,
    kf_action enum('ignore', 'deny', 'dissuade', 'allow', 'promote') not null,
    kf_what enum('all', 'from', 'to', 'replied', 'cc', bcc') not null,
    kf_context enum('user', 'forum', 'thread', 'comment') not null,
    kf_context_id int unsigned not null,

    index owner (kf_owner_uid, kf_context, kf_context_id)
);
When a post is made, and the program is writing the comment-to-user table, it will consult the kf_rule table where kf_owner_uid = the target user, and kf_context will be, in turn, the current thread, the current forum, the current user, etc.

Mind you none of this lives as real code just yet. It's still on my scratch book for the most part.

13 posted on 06/19/2002 5:15:42 PM PDT by John Robinson
[ Post Reply | Private Reply | To 7 | View Replies ]

To: smith288
kf_context also has an 'all' in that enum. And the value of kf_action, if found, is used to adjust the fate of a marker on the comment_user table. Regardless of what is in the killfile, a record will be written to comment_user-- that table is used for much more than self-search. The marker field will, however, be included in the self-search indexes.
15 posted on 06/19/2002 5:22:20 PM PDT by John Robinson
[ Post Reply | Private Reply | To 7 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson