Database Schema
BuddyLists creates three custom tables on activation, all prefixed with the site table prefix (wp_ by default). The schema version is tracked in the buddylists_db_version option, and upgrades run on plugins_loaded when the stored version is older.
{prefix}bp_lists
Section titled “{prefix}bp_lists”Holds the lists themselves.
| Column | Type | Notes |
|---|---|---|
id |
BIGINT UNSIGNED | Primary key, auto increment. |
user_id |
BIGINT UNSIGNED | Owner user ID. Indexed. |
name |
VARCHAR(255) | List name. |
description |
TEXT | Optional. |
slug |
VARCHAR(191) | Unique, indexed. Used in the public URL. Built from the list name, for example close-friends. |
cover_image |
VARCHAR(255) | Optional cover image URL. |
list_icon |
VARCHAR(255) | Optional icon URL. |
visibility |
ENUM(‘private’,‘public’) | Defaults to public. Indexed. |
created_at |
DATETIME | Defaults to the current timestamp. |
{prefix}bp_list_members
Section titled “{prefix}bp_list_members”Maps members to lists.
| Column | Type | Notes |
|---|---|---|
id |
BIGINT UNSIGNED | Primary key. |
list_id |
BIGINT UNSIGNED | Foreign key to bp_lists.id, cascade on delete. |
member_id |
BIGINT UNSIGNED | Foreign key to the users table, cascade on delete. Indexed. |
added_at |
DATETIME | Defaults to the current timestamp. |
A unique key unique_membership (list_id, member_id) prevents duplicate memberships.
{prefix}bp_list_relation
Section titled “{prefix}bp_list_relation”Tracks list follows.
| Column | Type | Notes |
|---|---|---|
id |
BIGINT UNSIGNED | Primary key. |
list_id |
BIGINT UNSIGNED | Foreign key to bp_lists.id, cascade on delete. |
follower_id |
BIGINT UNSIGNED | Foreign key to the users table, cascade on delete. Indexed. |
followed_at |
DATETIME | Defaults to the current timestamp. |
A unique key unique_follow (list_id, follower_id) prevents duplicate follows.
Upgrades
Section titled “Upgrades”The upgrade routine runs only when the stored database version is behind the plugin’s. It:
- Widens the
slugcolumn to 191 characters, because slugs are built from list names. - Adds the
list_iconcolumn when it is missing. - Adds the
unique_membershipandunique_followunique keys to existing installations, removing any duplicate rows first. - Copies list covers and icons that were stored in dated uploads folders into
uploads/buddylists/<list ID>/. Only real JPG, PNG and GIF pictures from dated folders that are not in the Media Library are copied. Anything else keeps its old URL. The originals are left where they were. - Moves the old
buddylists_activity_settingsoption intobuddylists_visibility_settings(thelist_visibleandenable_followkeys) and deletes the old option.
Images on disk
Section titled “Images on disk”Each list’s cover and icon are stored in wp-content/uploads/buddylists/<list ID>/. They are not Media Library attachments. Deleting a list deletes that folder.
Options
Section titled “Options”| Option | Holds |
|---|---|
buddylists_general_settings |
Label, address word, creation roles, blocked member types, limits. |
buddylists_visibility_settings |
Who can add people, suggestions, default privacy, private message, activity and follow options. |
buddylists_notification_settings |
On-site and email notice switches. |
buddylists_color_settings |
Custom color switch and the three colors. |
buddylists_db_version |
Schema version. |
Removal
Section titled “Removal”There is no uninstall routine. Deleting the plugin leaves the three tables, the options and the images folders in place.

