Datenbank-Schema

Datenbank-Schema

Übersicht über alle Datenbanktabellen und -spalten des Server Sync Plugins.

Migration: 2026_03_13_100000_create_server_sync_tables.php


Tabelle: server_sync_pairs

Speichert die Konfiguration der Sync-Paare.

Spalte Typ Nullable Standard Beschreibung
id bigint (PK) nein auto Primärschlüssel
main_server_id unsignedInt (FK) nein Hauptserver (CASCADE on delete)
sub_server_id unsignedInt (FK) nein Nebenserver (CASCADE on delete)
direction string(16) nein main_to_sub Sync-Richtung
scope string(16) nein paths Sync-Umfang (full / paths)
sync_paths json ja NULL Pfade für scope=paths
exclude_paths json ja NULL Ausgeschlossene Pfade
sync_mode string(16) nein live Live oder On Restart
interval_minutes unsignedInt nein 60 Sync-Intervall in Minuten
is_enabled boolean nein true Aktiviert/Deaktiviert
last_sync_at timestamp ja NULL Zeitpunkt der letzten Synchronisierung
last_sync_status string(32) ja NULL Status (success/failed/running/partial)
created_by unsignedInt (FK) ja NULL Erstellt von (SET NULL on delete)

Indizes: UNIQUE auf (main_server_id, sub_server_id), Index auf is_enabled, Index auf last_sync_at.


Tabelle: server_sync_logs

Protokolliert jede Sync-Ausführung.

Spalte Typ Nullable Beschreibung
id bigint (PK) nein Primärschlüssel
sync_pair_id unsignedBigInt (FK) nein Zugehöriges Sync-Paar (CASCADE)
direction_executed string(16) nein Ausgeführte Richtung
status string(16) nein success / failed / running / partial
files_synced unsignedInt ja Anzahl synchronisierter Dateien
bytes_transferred unsignedBigInt ja Übertragene Bytes
duration_seconds unsignedInt ja Dauer in Sekunden
error_message text ja Fehlermeldung
details json ja Details (synced_files, excluded_paths)
created_at timestamp nein Zeitstempel

Details JSON-Struktur:

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

Tabelle: server_sync_settings

Key-Value-Speicher für Plugin-Einstellungen (kein Auto-Increment, kein Timestamps).

Spalte Typ Beschreibung
key string (PK) Einstellungsname
value text (nullable) Einstellungswert

Spalte: servers.server_sync_limit

Wird zur bestehenden servers-Tabelle hinzugefügt:

Spalte Typ Standard Beschreibung
server_sync_limit unsignedInt 0 Max. Sync-Paare für diesen Server (0 = deaktiviert)