-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
🐛 Bulk adding tags created "duplicate" posts_tags rows from editor posts page #21787
base: main
Are you sure you want to change the base?
Conversation
…sts page TryGhost#21414 The commit includes a migration which adds a unique index to posts_tags table and handles the related error when bulk adding posts. The errors are ignored because the tags user wants to add are added/exist. This respects the editor's expectation as posts have the tags as the end result.
It looks like this PR contains a migration 👀 General requirements
Schema changes
Data changes
|
@kevinansfield @ErisDS @cathysarisky I have created a PR for this bug. I did 2 things:
Please merge it soon, if you find it worthy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heya, thanks for putting this together 🙏
Irreversible migrations can only be run in a major update, as they're effectively a breaking change. I would actually expect that to be enforced, and for CI to fail on this PR 🤔 Seems we're missing a check.
It would also be necessary to write a migration that cleans up any existing duplications, otherwise this migration will fail for anyone who has already run into this.
These migrations would need to live in ghost/core/core/server/data/migrations/versions/6.0
and be held back on a branch until such time as we cut the major.
Not sure if there's maybe an alternative fix for the short term?
Especially considering this is not only related to #21414 but also to #19871, which needs a UI-based fix I think.
#21414
The commit includes a migration which adds a unique index to posts_tags table and handles the related error when bulk adding posts.
The DB errors of duplicate insertions (for unique index) are ignored because the tags user wants to add are added/exist. This respects the editor's expectation as posts have the tags as the end result.