From 1c912d5feee218ef46a295c05652f2dc3bd4d1d5 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 22 May 2026 23:16:14 +0300 Subject: Add migration for missing playback_progress.finished column (5f) Existing databases created before the finished column was added to the base schema still satisfied CREATE TABLE IF NOT EXISTS and never got the column, causing GET /api/v1/media/{id} to fail with "SQL logic error: no such column: finished" and break media detail view. Co-Authored-By: Claude Sonnet 4.6 --- player-server/internal/repository/schema.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'player-server/internal') diff --git a/player-server/internal/repository/schema.go b/player-server/internal/repository/schema.go index 5d97a8b..2330991 100644 --- a/player-server/internal/repository/schema.go +++ b/player-server/internal/repository/schema.go @@ -261,6 +261,15 @@ ALTER TABLE podcast_feeds ADD COLUMN consecutive_failures INTEGER NOT NULL DEFAU ALTER TABLE podcast_feeds ADD COLUMN next_check_at DATETIME; `, }, + { + // Adds the "finished" flag used by GetProgress / SetProgress on the + // playback_progress table. Databases created before this column was + // introduced still satisfy the CREATE TABLE IF NOT EXISTS in the base + // schema, so the column must be added via migration to avoid a 500 on + // GET /api/v1/media/{id} reading from progress. + name: "add_playback_progress_finished", + sql: `ALTER TABLE playback_progress ADD COLUMN finished BOOLEAN NOT NULL DEFAULT 0;`, + }, } // runMigrations applies each migration in order, skipping ones whose SQL -- cgit v1.2.3