« Return to Thread: Taxonomy Schema Proposal

Re: Taxonomy Schema Proposal

by Ryan Boren :: Rate this Message:

Reply to Author | View in Thread

On 4/16/07, Jamie Talbot <wphackers@...> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Jamie Talbot wrote:
> > CREATE TABLE $wpdb->term_relationships (
> > object_id bigint(20) NOT NULL default '0',
> > term_taxonomy_id bigint(20) NOT NULL default '0'
> > PRIMARY KEY  (object_ID)
> > );
> >
>
> While I'm thinking about this, is the object_id from this table expected to always come from
> wp_posts?  Ryan mentioned this would also be for associating links.  If so, object_id can't be a
> primary key as we'll be using ids from different tables.  Better perhaps to have a primary key
> across the tuple, which will always be unique.  We'd also have to make sure we specified the
> taxonomy in every query to make sure we didn't get back the wrong type inadvertently.

Indeed, object_ID can be a post id or a link id or something provided
by a plugin.   Definitely need to keep that in mind when laying out
the keys.

Ryan
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

 « Return to Thread: Taxonomy Schema Proposal