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

Support annotations for imported entities #320

Merged
merged 4 commits into from
Jul 17, 2024

Conversation

kellnerd
Copy link
Contributor

@kellnerd kellnerd commented Jul 17, 2024

Problem

Annotations are not implemented for imported entities, because they have a last_revision_id INT NOT NULL column. Since an import does not have a revision, it is not possible to create a valid annotation row for it.

Solution

Actually use the given annotation data from the queued entity and insert it into the database with last_revision_id = NULL.
Before this code is usable, we have to make annotation.last_revision_id nullable in the schema and
in the code of bookbrainz-site.

P.S. Also sneaking in a minor DX QoL change with a032186.

kellnerd added 2 commits July 17, 2024 15:19
In order to allow imports (which have no revision) to have annotations,
we have to make `annotation.last_revision_id` nullable in the schema and
in the code of `bookbrainz-site`.
src/validators/common.ts Outdated Show resolved Hide resolved
MonkeyDo added a commit to metabrainz/bookbrainz-site that referenced this pull request Jul 17, 2024
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.

Much better, thanks for fixing the outdated code and adding tests!

src/validators/common.ts Show resolved Hide resolved
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