Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Data migration of many to many relations #108

Closed
ItaloF532 opened this issue Jul 28, 2023 · 1 comment · Fixed by #115
Closed

Data migration of many to many relations #108

ItaloF532 opened this issue Jul 28, 2023 · 1 comment · Fixed by #115
Assignees
Labels
issue: bug Issue reporting a bug severity: high If it breaks the basic use of the product source: v3-SQL to v4-SQL status: confirmed Confirmed by a Strapi Team member or multiple community members

Comments

@ItaloF532
Copy link

ItaloF532 commented Jul 28, 2023

Bug report

When I try to migrate my Strapi v3 to v4, some many to many relations doesn't going right, after debug the code I found an issue.

Required System information

  • Node.js version: 16.19.0
  • NPM version: 8.19.3
  • Strapi version: 4
  • Database: PG
  • Operating system: any
  • Is your project Javascript or Typescript: Javascript

Describe the bug

So in script v3-sql-v4-sql in the below part o code, the verification is incorrect.
Many to many relations doesn't has a column to relate, they has it's own table to make the relations. (I know in Strapi V4 all relations has it's own table, but if in migration the relation it's doesn't identified as many to many your data is gonna be wrong)

The part of code here

So, to fix it locally I do: if (value.column) >>> if (!value.column) ...

Steps to reproduce the behavior

1 - Strapi V3 with PG
2 - Has many to many relations in strapi V3
3 - Do the steps of migration described in https://github.com/strapi/migration-scripts

Expected behavior

Your many to many relations gonna be empty.

Screenshots

image
category schema
image

Additional context

Maybe can be related with this other issue

@derrickmehaffy derrickmehaffy transferred this issue from strapi/strapi Aug 15, 2023
@derrickmehaffy derrickmehaffy added issue: bug Issue reporting a bug severity: high If it breaks the basic use of the product source: v3-SQL to v4-SQL status: confirmed Confirmed by a Strapi Team member or multiple community members labels Oct 6, 2023
@derrickmehaffy
Copy link
Member

Related to internal TID4593

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue: bug Issue reporting a bug severity: high If it breaks the basic use of the product source: v3-SQL to v4-SQL status: confirmed Confirmed by a Strapi Team member or multiple community members
Projects
Status: Fixed/Shipped
Development

Successfully merging a pull request may close this issue.

3 participants