BB-634: feat(editor): Add Series to Series relationships support#1225
Open
atharvsp02 wants to merge 3 commits intometabrainz:masterfrom
Open
BB-634: feat(editor): Add Series to Series relationships support#1225atharvsp02 wants to merge 3 commits intometabrainz:masterfrom
atharvsp02 wants to merge 3 commits intometabrainz:masterfrom
Conversation
MonkeyDo
requested changes
Feb 10, 2026
Member
MonkeyDo
left a comment
There was a problem hiding this comment.
Thanks for looking into this improvement !
| BEGIN; | ||
|
|
||
| INSERT INTO bookbrainz.relationship_type ( | ||
| id, |
Member
There was a problem hiding this comment.
Ah, so you should be able to omit this column and not have to set a specific id for the rows.
An ID will be automatically generated.
This mean you'll have to remove the values in some other way in the down.sql script, for example by label, or where both source and target entity type are "Series"
Contributor
Author
There was a problem hiding this comment.
Removed specific IDs and deletion now uses labels
| // This ensures we don't add an entity of type X to a Series of entityType Y. | ||
| // For Example, a Work cannot be added to an Author Series. | ||
| const filterDifferentTypeSeries = (entity) => (entity.type === 'Series' ? baseEntity.type === entity.entityType : true); | ||
| const filterDifferentTypeSeries = (entity) => { |
Member
There was a problem hiding this comment.
This can be refactored, I think it's currently hard to understand the reasoning
if entity.type === 'Series'
return baseEntity.type === entity.entityType || baseEntity.type === 'Series'
else
return true
Contributor
Author
There was a problem hiding this comment.
Updated the filter logic as suggested
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Ticket: BB-634
BookBrainz currently does not support relationships between Series entities. Users cannot link related series (eg. subseries, translations etc.) to each other.
Solution
Added SQL migration with three new Series-to-Series relationship types,
Note: IDs 124, 125 and 126 are based on my local database where max existing ID was 123 (Foreword). Please adjust if production has different values.
Areas of Impact
bookbrainz.relationship_typetableScreenshot
Before(No Series shown)
After
Let me know if you have any suggestions or changes you’d like me to make.