From d3e4a5287d6f882aed0142a92126f8c3818bd2a9 Mon Sep 17 00:00:00 2001 From: Deluan Date: Sat, 14 Jan 2023 12:21:31 -0500 Subject: [PATCH] "Touch" playlists to force some clients to reload cover art --- .../20230114121537_touch_playlists.go | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 db/migration/20230114121537_touch_playlists.go diff --git a/db/migration/20230114121537_touch_playlists.go b/db/migration/20230114121537_touch_playlists.go new file mode 100644 index 00000000..50a9b4da --- /dev/null +++ b/db/migration/20230114121537_touch_playlists.go @@ -0,0 +1,20 @@ +package migrations + +import ( + "database/sql" + + "github.com/pressly/goose" +) + +func init() { + goose.AddMigration(upTouchPlaylists, downTouchPlaylists) +} + +func upTouchPlaylists(tx *sql.Tx) error { + _, err := tx.Exec(`update playlist set updated_at = datetime('now');`) + return err +} + +func downTouchPlaylists(tx *sql.Tx) error { + return nil +}