Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix author_trigger() recalculating search_vector of the wrong books #3313

Closed
wants to merge 1 commit into from

Conversation

Minnozz
Copy link

@Minnozz Minnozz commented Mar 11, 2024

The join that was used to match books to a changed author used the id column instead of the author_id column to join on authors.

This migration re-calculates all book search vectors to fix any missed author name changes.

@Minnozz Minnozz changed the title Fix author_trigger() Fix author_trigger() recalculating search_vector of the wrong books Mar 11, 2024
The join that was used to match books to a changed author used the id column instead of the
author_id column to join on authors.

This migration re-calculates all book search vectors to fix any missed author name changes.
@dato
Copy link
Contributor

dato commented Mar 12, 2024

Great catch!

There's a pending PR by me that introduces trigger migrations for easier maintenance (#3134), and fixes this bug too, I believe (if it does, it would be in bcb3a34: Fix JOIN in author_search_vector_trigger, add missing WHERE clause).

Since you already looked at trigger code… I'd be most grateful if at some point you can read, or review, that PR. The more eyes on such a tricky change, the better!

@Minnozz
Copy link
Author

Minnozz commented Mar 12, 2024

@dato I'll take a look at your PR later this week! (Though I can't officially review PRs (yet))

@Minnozz
Copy link
Author

Minnozz commented Mar 19, 2024

Closed in favor of #3134

@Minnozz Minnozz closed this Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants