[wp-hackers] Taxonomy Schema Proposal
Ryan Boren
ryan at boren.nu
Mon Apr 16 16:25:11 GMT 2007
On 4/16/07, Jamie Talbot <wphackers at jamietalbot.com> 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
More information about the wp-hackers
mailing list