[PR #4005] [MERGED] Add title triggers in new databases #4143

Closed
opened 2026-04-25 00:18:32 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4005
Author: @mikiher
Created: 2/19/2025
Status: Merged
Merged: 2/19/2025
Merged by: @advplyr

Base: masterHead: fix-triggers-for-new-databases


📝 Commits (1)

  • f9c0e52 Add title triggers in new databases

📊 Changes

1 file changed (+39 additions, -0 deletions)

View changed files

📝 server/Database.js (+39 -0)

📄 Description

Brief summary

Adds the new title[IgnorePrefix] update triggers (introduced in v2.19.1 and v2.19.4 migrations) if they don't exist, to handle new databases (for which migrations do not run).

Which issue is fixed?

Fixes #4003

In-depth Description

When triggers were added in migrations v2.19.1 and v2.19.4, I forgot to create those triggers in new databases, for which migrations don't run. Therefore, the new libraryItems columns title and titleIgnorePrefix were not updaed after a title was changed in a book or podcast, and the sort order wasn't updated.

I added code in Database.js to create the triggers if they don't exist.

How have you tested this?

Made sure that books/podcasts were correctly sorted after a title change in a newly created database (using edge code).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/4005 **Author:** [@mikiher](https://github.com/mikiher) **Created:** 2/19/2025 **Status:** ✅ Merged **Merged:** 2/19/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `fix-triggers-for-new-databases` --- ### 📝 Commits (1) - [`f9c0e52`](https://github.com/advplyr/audiobookshelf/commit/f9c0e52f18ea4c696f41c2900e06fd2f476236cf) Add title triggers in new databases ### 📊 Changes **1 file changed** (+39 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `server/Database.js` (+39 -0) </details> ### 📄 Description ## Brief summary Adds the new title[IgnorePrefix] update triggers (introduced in v2.19.1 and v2.19.4 migrations) if they don't exist, to handle new databases (for which migrations do not run). ## Which issue is fixed? Fixes #4003 ## In-depth Description When triggers were added in migrations v2.19.1 and v2.19.4, I forgot to create those triggers in new databases, for which migrations don't run. Therefore, the new libraryItems columns title and titleIgnorePrefix were not updaed after a title was changed in a book or podcast, and the sort order wasn't updated. I added code in Database.js to create the triggers if they don't exist. ## How have you tested this? Made sure that books/podcasts were correctly sorted after a title change in a newly created database (using edge code). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:32 +02:00
adam closed this issue 2026-04-25 00:18:32 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4143