Skip to content

Commit

Permalink
Migrate active playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Nov 27, 2024
1 parent b9b087b commit 284c91e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/migrations/003-populate-sql.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,16 @@ async function up({ context: uw }) {
.set({ items: jsonb(items) })
.execute();
}

if (user.activePlaylist != null) {
const activePlaylistID = playlistIDs.get(user.activePlaylist.toString());
if (activePlaylistID != null) {
await tx.updateTable('users')
.where('id', '=', userID)
.set({ activePlaylistID })
.execute();
}
}
}

for await (const entry of models.Authentication.find().lean()) {
Expand Down

0 comments on commit 284c91e

Please sign in to comment.