fix: prevent startup panics on databases missing base tables

The catch-up migration now creates the servers table if missing, like
sign_sessions. Startup cleanup queries in main.go use Exec instead of
MustExec so missing tables log warnings rather than panicking.
This commit is contained in:
Houmgaor
2026-03-16 00:04:45 +01:00
parent 31aa02a8e2
commit 7657ddbd50
2 changed files with 22 additions and 3 deletions

View File

@@ -14,6 +14,19 @@
-- 20-reset-warehouses — destructive data reset (NULLs all item_box columns)
------------------------------------------------------------------------
-- Ensure tables that predate the patch series exist. These were always
-- part of the base schema but may be missing from very old databases.
------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS public.servers (
server_id integer NOT NULL,
current_players integer NOT NULL,
world_name text,
world_description text,
land integer
);
------------------------------------------------------------------------
-- Patch 00: psn-id (sign_sessions primary key + psn columns)
------------------------------------------------------------------------