[wp-hackers] Database structure Wordpress

scribu scribu at gmail.com
Fri Dec 4 11:20:20 UTC 2009


On Thu, Dec 3, 2009 at 9:53 PM, Mike Schinkel
<mikeschinkel at newclarity.net>wrote:

> To use an example more concrete for WordPress, let's say you have two
> custom post types, "Products" and "Companies."  You could end up with three
> tables to manage this with one-to-one relationships between posts and
> products and between posts and companies:
>
> wp_posts
> wp_custom_products
> wp_custom_companies
>
> To see this structure in action look at Drupal's CCK module or the PODs
> plugin for WordPress.  And it is relationally correct.
>
> But again, this should probably be an option to the current metadata table
> approach for only if and when it is needed.
>

Given the principle that WP schema only contains tables that are actually
used by Core, it's pretty clear that this is plugin territory.

There aren't enough different columns between post, page & attachment to
warrant this approach.

Plus, the meta tables offer a lot more flexibility.

Also, there's nothing preventing you from building a custom table with
certain columns that you need to do complex queries with.


-- 
http://scribu.net


More information about the wp-hackers mailing list