[bbDev] bbPress meta data storage

Michael D Adams mikea at turbonet.com
Thu Nov 16 00:27:44 GMT 2006


On Nov 15, 2006, at 3:34 PM, Dougal Campbell wrote:
> Michael D Adams wrote:
>> 1. Keep the DB the same and change the bbPress code to allow multiple
>> entries per topic with the same meta_key.
>>
>> 2. change the DB to only three columns:
>> topic_id, meta_key, meta_value with a PRIMARY KEY of (topic_id,  
>> meta_key)
>
> While part of me feels like it should mirror the WP implementation,  
> for
> consistency, another part of me says that duplicate meta keys are
> probably an edge case in real-life use, and probably not worth the
> trouble. I vote for option 2.

My exact sentiments.  I do like consistency :)

But that doesn't keep me from option 2 either. I think if people are  
designing a bbPress plugin that really needs super efficient SELECTs  
for complicated extra data, they're probably adding extra tables anyway.

> I even wonder how much trouble it would cause if we made a similar
> change in WP. We could make the upgrade process check for duplicate  
> keys
> and combine them into a single key with a serialized array value, then
> modify the API functions to change how they access the data, while
> maintaining the old data structures.

Sounds great.  There are, of course, all the plugins that make their  
own queries (whether out of sloppy coding or the need for sneaky  
JOINs and such).

Michael


More information about the bbDev mailing list