Skip to Content
Mizu GuidebookDatabase Schema

Database Schema

๐Ÿ—„๏ธ
Auto-migrated
All tables and columns are created and migrated automatically on first start via oxmysql. No manual SQL import is required - this reference is for developers integrating with the data.

guidebook_categories

ColumnTypeDescription
idINT AUTO_INCREMENTPrimary key
keyVARCHAR(50) UNIQUEUnique identifier
titleVARCHAR(255)Display title
iconVARCHAR(100)Emoji or Font Awesome class
orderINTSort order (0-based)
enabledTINYINT1 = visible, 0 = hidden
collapsibleTINYINTWhether the category can be collapsed
expandedTINYINTDefault expanded state
permissionsTEXT (JSON)Job restrictions (see format below)
guidebook_idVARCHAR(50)Which guidebook this belongs to

guidebook_pages

ColumnTypeDescription
idINT AUTO_INCREMENTPrimary key
keyVARCHAR(50) UNIQUEUnique identifier
category_keyVARCHAR(50)Parent category key
titleVARCHAR(255)Display title
iconVARCHAR(100)Emoji or Font Awesome class
contentLONGTEXTHTML content (sanitized via DOMPurify)
orderINTSort order within category
enabledTINYINT1 = visible, 0 = hidden
permissionsTEXT (JSON)Job restrictions
updated_atTIMESTAMPAuto-updated on modification

guidebook_points

ColumnTypeDescription
idINT AUTO_INCREMENTPrimary key
keyVARCHAR(50) UNIQUEUnique identifier
labelVARCHAR(255)3D text label
coordsTEXT (JSON){"x": 0.0, "y": 0.0, "z": 0.0}
typeVARCHAR(20)Point type (text)
show_textTINYINTShow 3D text
text_sizeFLOATText size multiplier
text_colorVARCHAR(20)Text hex color
text_fontINTGTA text font ID
interact_text_sizeFLOATInteraction text size
interact_text_offsetFLOATInteraction text Z offset (above label)
text_z_offsetFLOATLabel height (Z) offset - added via auto-migration, default 1.0
draw_distanceFLOATDistance to render text
interact_distanceFLOATDistance to interact
show_markerTINYINTShow ground marker
marker_configTEXT (JSON)Marker type, color, size
marker_draw_distanceFLOATDistance to render the marker (default 20.0)
marker_sizeTEXT (JSON){"x":..,"y":..,"z":..} size override
marker_colorVARCHAR(20)Marker hex color override
marker_rotationTINYINTRotate the marker
marker_face_cameraTINYINTMarker always faces the camera
marker_z_offsetFLOATMarker vertical offset
show_blipTINYINTShow minimap blip
blip_configTEXT (JSON)Blip sprite, color, scale
can_navigateTINYINTAllow GPS navigation
open_page_keyVARCHAR(50)Page to open on interact (empty = standalone custom content)
custom_contentLONGTEXTCustom HTML content (used when no page is linked)
enabledTINYINT1 = active, 0 = disabled
permissionsTEXT (JSON)Job restrictions

guidebook_player_progress

Help point views - unique on (citizenid, point_key).

ColumnTypeDescription
idINT AUTO_INCREMENTPrimary key
citizenidVARCHAR(50)Player identifier (citizenid/identifier/license)
point_keyVARCHAR(50)Viewed help point key
viewed_atTIMESTAMPFirst view timestamp

guidebook_page_reads

Reading progress - unique on (citizenid, page_key). Drives the per-player progress bar and the โ€œNEWโ€ badge.

ColumnTypeDescription
idINT AUTO_INCREMENTPrimary key
citizenidVARCHAR(50)Player identifier
page_keyVARCHAR(50)Read page key
content_verVARCHAR(64)Content version (resets โ€œreadโ€ state when a page is edited)
read_atTIMESTAMPLast read timestamp

guidebook_history

Audit trail for rollback support.

ColumnTypeDescription
idINT AUTO_INCREMENTPrimary key
actionVARCHAR(50)create, update, delete, duplicate, import, rollback
entity_typeVARCHAR(20)category, page, point, all
entity_keyVARCHAR(50)Key of the affected entity
player_idVARCHAR(50)Player identifier
player_nameVARCHAR(100)Player name
detailsTEXTAction details + optional SNAPSHOT: JSON for rollback
created_atTIMESTAMPWhen the action occurred

guidebook_analytics

Page views.

ColumnTypeDescription
idINT AUTO_INCREMENTPrimary key
page_keyVARCHAR(50)Viewed page key
player_idVARCHAR(50)Viewer identifier
viewed_atTIMESTAMPView timestamp

Permissions JSON Format

The permissions column stores a JSON array of job requirements:

[ {"job": "police", "grade": 0}, {"job": "ambulance", "grade": 2} ]
  • Empty array or null = visible to everyone
  • Multiple entries = player needs ANY of the listed jobs (OR logic)
  • grade = minimum grade required
  • Permission groups: use @groupname as the job name (e.g. @emergency)
Last updated on