WordPress Schema
I was playing with some Php yesterday and noticed a few stupid funny interesting things about the WordPress schema:
- It uses
unsigned BIGINT(20)for the post indexes, so it supports up to 18,446,744,073,709,551,615 posts - It applies each of the known column-naming conventions I’ve seen in the past 15 years:
post_id,postID,ID, andid - It has a handful of depreciated columns, and even more de-normalized columns
The schema works, and WP is a useful tool, but it is always funny interesting to see what’s hidden beneath the surface. Wordpress has grown quickly over the years, and been passed between a few core teams of developers. The fact that it’s inconsistent is natural (and expected).
The goal of my php-playtime was to replace WP in a few hours, as I assumed that the schema was sane. I succeeded, but spent most of the time cleaning up the schema, so that I didn’t choke on my tea laughing at the weirdness. It was an entertaining excercise too, as it gave me time think about what I really want in a writing tool (as I’m never exactly sure if I should bother rewriting it or not).
