-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Description
Node Version
22.20.0
NPM/Yarn/PNPM Version
1.22.2
Strapi Version
5.27.0
Operating System
MacOS
Database
SQLite
Javascript or Typescript
Typescript
Reproduction URL
No response
Bug Description
When migrating to v5, self-referential content types related via a module do not migrate correctly.
I have a content type (theme
) that includes a relation to itself through a module (highlight
).
After migration, the relation between published and draft documents is incomplete:
- In the database, the published document retains one relation (as expected).
- However, the (unpublished) document has no relation.
Observation
-
I have two
themes
from v4, which is correct. -
In
themes_cmps
, thehighlight
module correctly connects to all themes. -
In
components_modules_highlights
, four components exist — as expected. -
The problem appears in
components_modules_highlights_theme_lnk
:
there is no link tohighlight
with ID 3, which causes the relation issue.
Steps to Reproduce
- Create a new v4 Strapi project
- Create a content type with a module that has a relation to that content type
- Create an entry that has a relation to itself in the module
- Migrate to v5, open the content type again
- The relation has disappeared
Expected Behavior
During migration, relations between self-referential content types should be preserved for both published and draft documents.
Logs
Code Snippets
No response
Media
V4

V5

The code of the migrated v5 repository
Additional information
No response
Confirmation Checklist
- I have checked the existing issues for duplicates.
- I agree to follow this project's Code of Conduct.