[wp-trac] [WordPress Trac] #14513: Time for a wp_post_relationships table?

WordPress Trac wp-trac at lists.automattic.com
Tue Aug 3 00:10:31 UTC 2010


#14513: Time for a wp_post_relationships table?
-----------------------------+----------------------------------------------
 Reporter:  mikeschinkel     |       Owner:                 
     Type:  feature request  |      Status:  new            
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Post Types       |     Version:  3.0.1          
 Severity:  normal           |    Keywords:                 
-----------------------------+----------------------------------------------
 Now that we have custom post types the obvious next step for people using
 them is to start relating post types using parent-child and/or many-to-
 many relationships.  I've implemented a taxonomy-mirrored-posts plugin but
 am starting to discover [http://lists.automattic.com/pipermail/wp-
 hackers/2010-July/033510.html many of the problems that @prettyboymp has
 pointed out on wp-hackers] and think it might be time we consider adding a
 new table to allow us to relate post and to allow us to build
 functionality around this table such as related post pickers, etc.

 I'd like to offer a [http://en.wikipedia.org/wiki/Straw_man_proposal straw
 man proposal] to start discussions of a potential `wp_post_relationships`
 table added to WordPress 3.1 with three fields: `parent_id`, `post_id` and
 `term_taxonomy_id.` This allows us to relate any two post records and
 optionally associate at taxonomy+term to classify the relationship (here's
 the SQL to create the table):

 {{{
 CREATE TABLE `wp_post_relationships` (
   `parent_id` bigint(20) unsigned NOT NULL,
   `post_id` bigint(20) unsigned NOT NULL,
   `term_taxonomy_id` bigint(20) unsigned NOT NULL DEFAULT '0',
   PRIMARY KEY (`parent_id`,`post_id`,`term_taxonomy_id`),
   KEY `term_taxonomy_id` (`term_taxonomy_id`),
   KEY `post_id` (`post_id`)
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 }}}

 Looking forward to your feedback.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14513>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list