From cc56b9ef2a5e8377967087e1fa36c9c3a1e32139 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Fri, 30 Oct 2026 16:55:16 -0400 Subject: [PATCH] fix(collections): UpdateCollectionViewSettings wrote a nonexistent updated_at column MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The query said `SET view_settings = $2, updated_at = NOW()` but the collections table has never had an updated_at column — every call failed with 42703. The one caller (media_scanner's series-import provenance write) discards the error, so the failure was silent: imported-from-series view settings never persisted. Surfaced while writing the sibling UpdateCollectionMatchMode query for item 2.4 (the item-2.4 commit message prematurely claimed this fix — this is that fix, for real). --- internal/database/queries.sql.go | 6 +++++- internal/database/queries/queries.sql | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/database/queries.sql.go b/internal/database/queries.sql.go index 90f58889..e6f02e03 100644 --- a/internal/database/queries.sql.go +++ b/internal/database/queries.sql.go @@ -18317,7 +18317,7 @@ func (q *Queries) UpdateCollectionRulesJSON(ctx context.Context, arg UpdateColle } const UpdateCollectionViewSettings = `-- name: UpdateCollectionViewSettings :exec -UPDATE collections SET view_settings = $2, updated_at = NOW() WHERE id = $1 +UPDATE collections SET view_settings = $2 WHERE id = $1 ` type UpdateCollectionViewSettingsParams struct { @@ -18327,6 +18327,10 @@ type UpdateCollectionViewSettingsParams struct { // A2c §2.4: provenance + playlist flags on an existing collection without // touching the rest of the row. +// (Historical bug, fixed 2026-10-30: this wrote `updated_at = NOW()` but +// collections has no updated_at column — the scanner's series-import +// call has been failing silently, its error discarded. Fixed by +// dropping the phantom column write.) func (q *Queries) UpdateCollectionViewSettings(ctx context.Context, arg UpdateCollectionViewSettingsParams) error { _, err := q.db.Exec(ctx, UpdateCollectionViewSettings, arg.ID, arg.ViewSettings) return err diff --git a/internal/database/queries/queries.sql b/internal/database/queries/queries.sql index 3433ad6e..a0b163b8 100644 --- a/internal/database/queries/queries.sql +++ b/internal/database/queries/queries.sql @@ -3496,7 +3496,11 @@ RETURNING *; -- A2c §2.4: provenance + playlist flags on an existing collection without -- touching the rest of the row. -- name: UpdateCollectionViewSettings :exec -UPDATE collections SET view_settings = $2, updated_at = NOW() WHERE id = $1; +-- (Historical bug, fixed 2026-10-30: this wrote `updated_at = NOW()` but +-- collections has no updated_at column — the scanner's series-import +-- call has been failing silently, its error discarded. Fixed by +-- dropping the phantom column write.) +UPDATE collections SET view_settings = $2 WHERE id = $1; -- Smart-collection match semantics (plan item 2.4): flip any|all on its -- own channel — the rules page toggle writes exactly this column.