Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Self-referencing relations not migrated to v5 #24544

Copy link
Copy link
@Rowan-Paul

Description

@Rowan-Paul
Issue body actions

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, the highlight 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 to highlight with ID 3, which causes the relation issue.

Steps to Reproduce

  1. Create a new v4 Strapi project
  2. Create a content type with a module that has a relation to that content type
  3. Create an entry that has a relation to itself in the module
  4. Migrate to v5, open the content type again
  5. 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

Image

The code of the v4 repository

The v4 database

V5

Image

The code of the migrated v5 repository

The v5 database

Additional information

No response

Confirmation Checklist

hayedewit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.