[PR #3971] [CLOSED] Change ambiguous column names to non-ambiguous ones #4135

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3971
Author: @mikiher
Created: 2/12/2025
Status: Closed

Base: masterHead: fix-ambiguous-column-names


📝 Commits (1)

  • afaa618 Change ambiguous column name to non-ambiguous ones

📊 Changes

6 files changed (+424 additions, -11 deletions)

View changed files

📝 server/migrations/changelog.md (+1 -0)
server/migrations/v2.19.2-change-ambigous-column-names.js (+180 -0)
📝 server/models/LibraryItem.js (+6 -6)
📝 server/scanner/BookScanner.js (+2 -2)
📝 server/utils/queries/libraryItemsBookFilters.js (+2 -3)
test/server/migrations/v2.19.2-change-ambigous-column-names.test.js (+233 -0)

📄 Description

Brief summary

This changes the names of newly introduced title and titleIgnorePrefix columns in libraryItems to titleCopy and titleIgnorePrefixCopy.

Which issue is fixed?

Fixes #3966

In-depth Description

The new libraryItems columns introduced in PR #3952 caused some unforseen side effects due to having the same name as columns in books, causing crashes in a number of unrelated database queries in the code. I fixed this by changing the new column names to unabiguous ones, titleCopy and titleIgnorePrefixCopy

This required an additional migration and changing the references to these new columns in the code.

How have you tested this?

Reported crashes in search and library page with collapsed series do not occur anymore.
Performance improvements introduced in #3952 have not regressed.


🔄 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/3971 **Author:** [@mikiher](https://github.com/mikiher) **Created:** 2/12/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fix-ambiguous-column-names` --- ### 📝 Commits (1) - [`afaa618`](https://github.com/advplyr/audiobookshelf/commit/afaa618f468ba1e488d33a1b3791d0a52e6697d7) Change ambiguous column name to non-ambiguous ones ### 📊 Changes **6 files changed** (+424 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `server/migrations/changelog.md` (+1 -0) ➕ `server/migrations/v2.19.2-change-ambigous-column-names.js` (+180 -0) 📝 `server/models/LibraryItem.js` (+6 -6) 📝 `server/scanner/BookScanner.js` (+2 -2) 📝 `server/utils/queries/libraryItemsBookFilters.js` (+2 -3) ➕ `test/server/migrations/v2.19.2-change-ambigous-column-names.test.js` (+233 -0) </details> ### 📄 Description ## Brief summary This changes the names of newly introduced `title` and `titleIgnorePrefix` columns in `libraryItems` to `titleCopy` and `titleIgnorePrefixCopy`. ## Which issue is fixed? Fixes #3966 ## In-depth Description The new libraryItems columns introduced in PR #3952 caused some unforseen side effects due to having the same name as columns in `books`, causing crashes in a number of unrelated database queries in the code. I fixed this by changing the new column names to unabiguous ones, `titleCopy` and `titleIgnorePrefixCopy` This required an additional migration and changing the references to these new columns in the code. ## How have you tested this? Reported crashes in search and library page with collapsed series do not occur anymore. Performance improvements introduced in #3952 have not regressed. --- <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:27 +02:00
adam closed this issue 2026-04-25 00:18:27 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4135