Database Schema

Database Schema

Overview of all database tables and columns of the Server Sync plugin.

Migration: 2026_03_13_100000_create_server_sync_tables.php


Table: server_sync_pairs

Stores sync pair configurations.

Column Type Nullable Default Description
id bigint (PK) no auto Primary key
main_server_id unsignedInt (FK) no Main server (CASCADE on delete)
sub_server_id unsignedInt (FK) no Sub server (CASCADE on delete)
direction string(16) no main_to_sub Sync direction
scope string(16) no paths Sync scope (full / paths)
sync_paths json yes NULL Paths for scope=paths
exclude_paths json yes NULL Excluded paths
sync_mode string(16) no live Live or On Restart
interval_minutes unsignedInt no 60 Sync interval in minutes
is_enabled boolean no true Enabled/Disabled
last_sync_at timestamp yes NULL Time of last synchronization
last_sync_status string(32) yes NULL Status (success/failed/running/partial)
created_by unsignedInt (FK) yes NULL Created by (SET NULL on delete)

Indexes: UNIQUE on (main_server_id, sub_server_id), Index on is_enabled, Index on last_sync_at.


Table: server_sync_logs

Logs each sync execution.

Column Type Nullable Description
id bigint (PK) no Primary key
sync_pair_id unsignedBigInt (FK) no Associated sync pair (CASCADE)
direction_executed string(16) no Executed direction
status string(16) no success / failed / running / partial
files_synced unsignedInt yes Number of synchronized files
bytes_transferred unsignedBigInt yes Transferred bytes
duration_seconds unsignedInt yes Duration in seconds
error_message text yes Error message
details json yes Details (synced_files, excluded_paths)
created_at timestamp no Timestamp

Details JSON Structure:

{
  "synced_files": ["mods/mod1.jar", "config/server.properties"],
  "excluded_paths": ["logs", "cache"]
}

Table: server_sync_settings

Key-value store for plugin settings (no auto-increment, no timestamps).

Column Type Description
key string (PK) Setting name
value text (nullable) Setting value

Column: servers.server_sync_limit

Added to the existing servers table:

Column Type Default Description
server_sync_limit unsignedInt 0 Max sync pairs for this server (0 = disabled)