Core Tables

Content Tables

posts

The primary content table.

ColumnTypeNotes
idINT UNSIGNED PK
user_idINT UNSIGNEDFK to Shield users.id
titleVARCHAR(255)
slugVARCHAR(255) UNIQUEURL segment
bodyLONGTEXTRaw content (markdown or HTML)
formatENUM('html','markdown')Determines render pipeline
excerptTEXT NULLManual excerpt; fallback to auto-generated
featured_imageVARCHAR(512) NULLPath or URL
statusENUM('draft','published','scheduled')
is_premiumTINYINT(1)Paywall flag
meta_titleVARCHAR(255) NULLSEO override
meta_descriptionTEXT NULLSEO override
published_atDATETIME NULLNull = draft
scheduled_atDATETIME NULLFuture publish time
share_on_publishTINYINT(1)Auto-share to social on publish
created_atDATETIME NULL
updated_atDATETIME NULL
deleted_atDATETIME NULLSoft delete

pages

Static CMS pages. Same structure as posts minus category/tag joins. Adds:

ColumnTypeNotes
parent_idINT UNSIGNED NULLFor hierarchical pages
templateVARCHAR(100) NULLTheme template override

categories

ColumnType
idINT UNSIGNED PK
nameVARCHAR(100)
slugVARCHAR(100) UNIQUE
descriptionTEXT NULL
parent_idINT UNSIGNED NULL
sort_orderINT
created_atDATETIME NULL
updated_atDATETIME NULL

tags

ColumnType
idINT UNSIGNED PK
nameVARCHAR(100)
slugVARCHAR(100) UNIQUE
created_atDATETIME NULL
updated_atDATETIME NULL

posts_to_categories / tags_to_posts

Pivot tables. Both follow the same pattern:

posts_to_categories: post_id (FK), category_id (FK), PRIMARY KEY(post_id, category_id)
tags_to_posts:       tag_id (FK),  post_id (FK),     PRIMARY KEY(tag_id, post_id)

comments

ColumnTypeNotes
idINT UNSIGNED PK
post_idINT UNSIGNEDFK to posts
user_idINT UNSIGNED NULLFK if authenticated commenter
author_nameVARCHAR(100)Guest name
author_emailVARCHAR(255)
bodyTEXT
statusENUM('approved','pending','spam','trash')
parent_idINT UNSIGNED NULLThreaded replies
created_atDATETIME NULL

post_revisions

Stores previous versions of post body on each save.

ColumnType
idINT UNSIGNED PK
post_idINT UNSIGNED
user_idINT UNSIGNED
bodyLONGTEXT
created_atDATETIME NULL

Appearance Tables

themes

ColumnType
idINT UNSIGNED PK
nameVARCHAR(100)
folderVARCHAR(100) UNIQUE
versionVARCHAR(20)
authorVARCHAR(100)
statusENUM('active','inactive','unavailable')
pv_safeTINYINT(1)
created_atDATETIME NULL
updated_atDATETIME NULL

theme_options

Key-value store for theme configuration. One row per option key per theme.

ColumnType
idINT UNSIGNED PK
theme_idINT UNSIGNED
option_keyVARCHAR(100)
option_valueTEXT

widgets

ColumnType
idINT UNSIGNED PK
nameVARCHAR(100)
slugVARCHAR(100) UNIQUE
folderVARCHAR(100)
versionVARCHAR(20)
descriptionTEXT NULL
statusENUM('active','inactive','unavailable')
pv_safeTINYINT(1)
created_atDATETIME NULL
updated_atDATETIME NULL

widget_areas

Named slots defined by themes.

ColumnType
idINT UNSIGNED PK
nameVARCHAR(100)
slugVARCHAR(100) UNIQUE
descriptionTEXT NULL

widget_instances

A placed, configured widget assigned to an area.

ColumnType
idINT UNSIGNED PK
widget_idINT UNSIGNED
area_idINT UNSIGNED
options_jsonTEXT
sort_orderINT
is_activeTINYINT(1)
created_atDATETIME NULL
updated_atDATETIME NULL

System Tables

plugins

ColumnType
idINT UNSIGNED PK
nameVARCHAR(100)
folderVARCHAR(100) UNIQUE
namespaceVARCHAR(100)
versionVARCHAR(20)
statusENUM('active','inactive','unavailable')
pv_safeTINYINT(1)
created_atDATETIME NULL
updated_atDATETIME NULL

settings

Generic key-value store for CMS configuration.

ColumnType
idINT UNSIGNED PK
classVARCHAR(100)
keyVARCHAR(100)
valueTEXT NULL
typeVARCHAR(20)
contextVARCHAR(255) NULL

marketplace_items

ColumnType
idINT UNSIGNED PK
slugVARCHAR(100) UNIQUE
typeENUM('theme','plugin','widget')
installed_versionVARCHAR(20)
license_keyVARCHAR(64) NULL
created_atDATETIME NULL
updated_atDATETIME NULL

marketplace_licenses

ColumnType
idINT UNSIGNED PK
marketplace_item_idINT UNSIGNED
license_keyVARCHAR(64)
is_validTINYINT(1)
last_checkedDATETIME NULL
created_atDATETIME NULL
updated_atDATETIME NULL

Analytics Tables

activity_logs

ColumnType
idINT UNSIGNED PK
user_idINT UNSIGNED
usernameVARCHAR(100)
actionVARCHAR(100)
subject_typeVARCHAR(50)
subject_idINT UNSIGNED
descriptionTEXT NULL
ip_addressVARCHAR(45)
created_atDATETIME NULL

page_views

ColumnType
idINT UNSIGNED PK
post_idINT UNSIGNED NULL
urlVARCHAR(512)
ip_hashVARCHAR(64)
created_atDATETIME NULL

User Tables

author_profiles

Extension of Shield users with public-facing profile data.

ColumnType
idINT UNSIGNED PK
user_idINT UNSIGNED UNIQUE
display_nameVARCHAR(100)
bioTEXT NULL
avatar_urlVARCHAR(512) NULL
websiteVARCHAR(512) NULL
twitterVARCHAR(100) NULL
created_atDATETIME NULL
updated_atDATETIME NULL