[wp-trac] [WordPress Trac] #10905: Do not allow duplicate (post_id, meta_key, meta_value) rows in meta tables

WordPress Trac wp-trac at lists.automattic.com
Mon Dec 21 16:29:24 UTC 2009


#10905: Do not allow duplicate (post_id, meta_key, meta_value) rows in meta tables
--------------------------+-------------------------------------------------
 Reporter:  scribu        |       Owner:  ryan          
     Type:  defect (bug)  |      Status:  new           
 Priority:  normal        |   Milestone:  Future Release
Component:  Database      |     Version:  2.9           
 Severity:  normal        |    Keywords:  needs-patch   
--------------------------+-------------------------------------------------

Comment(by scribu):

 The reason why I said that then, was this reply:

 [wp-hackers] On 2/26/09, aesqe <aesqe at skyphe.org> wrote:
 > i think this is the right behavior - how else would a plugin like
 > flutter have grouped custom fields?
 >
 > i don't know how many of you are familiar with flutter, but here's an
 > example:
 >
 > let's say you have a group called reviews, and that group can be
 duplicated.
 >
 > let's say that it has three fields:
 >
 > * reviewer_name
 > * reviewer_magazine
 > * review_text
 >
 > and if two journalists from the same magazine write a review about that
 > particular post (which is actually a book, or a movie, etc)
 >
 > then too, you'd have the same situation:
 >
 > *meta_id*  *post_id*  *meta_key *             *meta_value*
 >    001          001     reviewer_magazine         bar
 >    002          001     reviewer_magazine         bar
 >
 > and flutter has its own table in which it stores relations between
 > custom fields and groups, so this works jus fine.

 But after I thought about it more, it just hit me that that's not a good
 reason at all. There are better ways to achieve what Flutter is doing,
 without having the same data duplicated over and over again.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10905#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list