From ba9a2b3d57304e41fcf4b9e742ea32bacca4e95c Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Sat, 19 Sep 2026 00:30:14 +0200 Subject: [PATCH] fix(db): apply additive schema changes on every boot Migration was gated on a version-bump marker, so new columns added between releases (task.hidden, user.ban_expires, storage_policies.status) never reached existing databases and the server failed at first use. Schema.Create is diff-based and never drops columns by default, so running it unconditionally is a no-op when the schema matches. Authored By: TDvorak Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- inventory/client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inventory/client.go b/inventory/client.go index b51d29cf..af65a6fb 100644 --- a/inventory/client.go +++ b/inventory/client.go @@ -37,6 +37,11 @@ func InitializeDBClient(l logging.Logger, return nil, fmt.Errorf("failed to migrate database: %w", err) } } else { + // Version is current, but additive schema changes (new columns) + // still need to reach existing databases between releases. + if err := client.Schema.Create(ctx); err != nil { + return nil, fmt.Errorf("failed to apply additive schema changes: %w", err) + } l.Info("Database schema is up to date.") }