IBX-12078: Adjusted index of content id and version to be unique#780
Open
bnowak wants to merge 5 commits into
Open
IBX-12078: Adjusted index of content id and version to be unique#780bnowak wants to merge 5 commits into
bnowak wants to merge 5 commits into
Conversation
59514b1 to
5421938
Compare
konradoboza
approved these changes
Jul 14, 2026
alongosz
approved these changes
Jul 14, 2026
alongosz
reviewed
Jul 14, 2026
ViniTou
approved these changes
Jul 15, 2026
Contributor
Author
@ViniTou I didn't find |
Steveb-p
approved these changes
Jul 15, 2026
…uplicate content id and version number
69f83dd to
6c6531b
Compare
|
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.



Related PRs:
Description:
The
ibexa_content_versiontable allowed multiple rows with the same (contentobject_id,version) pair - nothing on the database level prevented duplicate content versions (e.g. created by concurrent version-creating requests). The missing key was discovered while working on IBX-12029.Changes:
ibexa_content_version_idx_verindex on (contentobject_id,version) with theuq_ibexa_content_version_coid_versionunique constraint, so duplicate version rows are now rejected by the database itself.contentobject_idcolumn non-nullable - it is part of the new unique key, and a version row without a content id is not a valid state.DoctrineDatabase::insertVersion()throwsUniqueConstraintViolationExceptionwhen inserting a duplicate (contentobject_id,version) pair.Migration scripts for existing installations are handled in the related installer PR. Databases already containing duplicates must be cleaned up before applying the migration - see the Documentation section below for detection and cleanup snippets.
For QA:
SQL snippet to reproduce duplicates in db:
Documentation:
SQL snippet to list all duplicates in the database. Clients can use that to locate content versions that need fixes (duplicates removal):
SQL snippets as proposed solution for client to automatically removing of duplicates: