Add multi-server data model + legacy DB migration (step 0)

Adds Server.ID/Name, ServerInterface.Name, Client.ServerID, and a new
ServerSetting type as additive fields so existing single-server code
paths keep working unchanged. jsondb.Init() now detects a pre-existing
single-server db/server/ layout and mirrors it into new servers/,
server_settings/, server_hashes/ collections plus backfills ServerID
on existing clients, without touching/removing the legacy files yet.
This commit is contained in:
sysops
2026-07-11 22:35:45 +02:00
parent e5c0a5888f
commit 40d7862702
4 changed files with 142 additions and 0 deletions
+11
View File
@@ -15,3 +15,14 @@ type GlobalSetting struct {
ConfigFilePath string `json:"config_file_path"`
UpdatedAt time.Time `json:"updated_at"`
}
// ServerSetting model holds the per-server-interface subset of settings
// that used to live in the single global GlobalSetting. Introduced for the
// multi-server extension; not yet wired into store/handler layers.
type ServerSetting struct {
EndpointAddress string `json:"endpoint_address"`
FirewallMark string `json:"firewall_mark"`
Table string `json:"table"`
ConfigFilePath string `json:"config_file_path"`
UpdatedAt time.Time `json:"updated_at"`
}