Skip to content

BB-634: feat(editor): Add Series to Series relationships support#1225

Open
atharvsp02 wants to merge 3 commits intometabrainz:masterfrom
atharvsp02:BB-634
Open

BB-634: feat(editor): Add Series to Series relationships support#1225
atharvsp02 wants to merge 3 commits intometabrainz:masterfrom
atharvsp02:BB-634

Conversation

@atharvsp02
Copy link
Contributor

@atharvsp02 atharvsp02 commented Feb 7, 2026

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,

  • Subseries, Translation, and Followed By.

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

  • Database: New relationship types added to bookbrainz.relationship_type table
  • Entity Editor: Updated filter to allow Series-to-Series search
  • User Flow: Users can now create relationships between Series entities

Screenshot

Before(No Series shown)

image

After

image

Let me know if you have any suggestions or changes you’d like me to make.

Copy link
Member

@MonkeyDo MonkeyDo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this improvement !

BEGIN;

INSERT INTO bookbrainz.relationship_type (
id,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the filter logic as suggested

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.

2 participants

Comments