strapi / migration-scripts

Collection of Strapi Migration scripts
58 stars 57 forks source link

Data migration of many to many relations #108

Closed ItaloF532 closed 9 months ago

ItaloF532 commented 1 year ago

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

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 commented 9 months ago

Related to internal TID4593