Skip to main content

๐Ÿ“ฆ Database Schema

Monitron SaaS uses 14 migration files creating 20+ tables. Here's the complete schema reference.


๐Ÿ“Š Core Tablesโ€‹

usersโ€‹

ColumnTypeDescription
idbigint PK
namestringDisplay name
emailstring (unique)Login email
passwordstringHashed password
avatar_urlstring (nullable)Profile picture URL
timezonestringUser's timezone
localestringLanguage preference
two_factor_secrettext (nullable)2FA secret
is_adminbooleanSuper admin flag
current_team_idFK โ†’ teamsActive team

teamsโ€‹

ColumnTypeDescription
idbigint PK
namestringTeam name
slugstring (unique)URL-friendly identifier
owner_idFK โ†’ usersTeam owner
settingsjson (nullable)Team-specific settings

team_user (pivot)โ€‹

ColumnType
team_idFK โ†’ teams
user_idFK โ†’ users
rolestring (owner/admin/member)

๐Ÿ“ก Monitoring Tablesโ€‹

monitorsโ€‹

ColumnTypeDescription
idbigint PK
team_idFK โ†’ teamsOwning team
namestringDisplay name
typestring (enum)Monitor type
addressstringURL, hostname, or IP
portint (nullable)Port number
interval_secondsintCheck frequency
timeout_secondsintMax wait time
configjson (nullable)Type-specific configuration
is_activebooleanActive flag
is_pausedbooleanManually paused
statusstring (enum)Current status
last_response_time_msint (nullable)Latest response time
last_checked_atdatetime (nullable)Last check timestamp
last_up_at / last_down_atdatetime (nullable)Last status change
consecutive_failuresintFailure counter
uptime_percentagedecimal(7,3)30-day uptime
heartbeat_tokenstring (nullable)Unique heartbeat URL token
tagsjson (nullable)Categorization tags
notestext (nullable)User notes

monitor_checksโ€‹

High-volume table โ€” stores every check result:

ColumnTypeDescription
idbigint PK
monitor_idFK โ†’ monitors
statusstringCheck result status
response_time_msint (nullable)Response time
status_codeint (nullable)HTTP status code
error_messagetext (nullable)Error details
metadatajson (nullable)Extra data (headers, cert info, etc.)
checked_atdatetimeWhen the check ran

Indexes: (monitor_id, checked_at) for fast time-range queries.


๐Ÿ”ฅ Incident Tablesโ€‹

incidentsโ€‹

ColumnTypeDescription
idbigint PK
team_idFK โ†’ teams
monitor_idFK โ†’ monitors (nullable)Related monitor
titlestringIncident title
severitystring (enum)Info/Warning/Critical/Emergency
statusstring (enum)Investigating/Identified/Monitoring/Resolved
descriptiontext (nullable)Details
started_atdatetimeWhen it started
acknowledged_atdatetime (nullable)When acknowledged
acknowledged_byFK โ†’ users (nullable)Who acknowledged
resolved_atdatetime (nullable)When resolved
resolved_byFK โ†’ users (nullable)Who resolved

incident_updatesโ€‹

Timeline entries for incidents.


๐Ÿ”” Notification Tablesโ€‹

alert_rules, contacts, contact_groups, notification_logsโ€‹

Alert routing, contact management, and delivery logging.


๐Ÿ“Š Other Tablesโ€‹

status_pages, status_page_components, status_page_subscribersโ€‹

Public status page configuration and subscribers.

server_agents, server_metricsโ€‹

Server monitoring agent data.

certificates, domainsโ€‹

SSL certificate and domain WHOIS data.

maintenance_windows, audit_logs, app_settingsโ€‹

Scheduled maintenance, audit trail, and dynamic configuration.