[wp-hackers] Taxonomy Schema Proposal

Steve Lewis stevelle at gmail.com
Mon Apr 16 18:13:05 GMT 2007


On 4/16/07, Ryan Boren <ryan at boren.nu> wrote:
>
> // terms contains the actual
> categories/tags/terms/classifiers/whatevers.  It stores only ID, name,
> and slug.
> CREATE TABLE $wpdb->terms (
> term_id bigint(20) NOT NULL auto_increment,
> term_name varchar(55) NOT NULL default '',
> term_slug varchar(200) NOT NULL default '',
> PRIMARY KEY  (term_ID),
> KEY term_slug (term_slug)
> );
> // term_taxonomy puts a term in the context of a taxonomy (link
> category, post category, or tag).  Hierarchy is put here as well as
> counts.
> CREATE TABLE $wpdb->term_taxonomy (
> term_id bigint(20) NOT NULL default '0',
> taxonomy varchar(20) NOT NULL default '0',
> term_description longtext NOT NULL,
> parent bigint(20) NOT NULL default '0',
> count bigint(20) NOT NULL default '0'
> );
> // term_relationships relates a term to a post or link or undeclared
> future object thingy.  The relationship is placed within the context
> of a given taxonomy.
> CREATE TABLE $wpdb->term_relationships (
> object_id bigint(20) NOT NULL default '0',
> term_id bigint(20) NOT NULL default '0',
> taxonomy varchar(20) NOT NULL default '0',
> PRIMARY KEY  (object_ID),
> );
>

I would like to ask you to expound on three use cases:
 - Aliases  (for instance: products -> projects)
 - Lookup by slug (myblog.com/projects)
 - Both together (myblog.com/products)

I don't want to presume too much about your intentions.

-- 
SteveL


More information about the wp-hackers mailing list