strapi / migration-scripts

Collection of Strapi Migration scripts
58 stars 57 forks source link

Fix import issues with composite table names #92

Closed molund closed 6 months ago

molund commented 1 year ago

This PR fixes an issue that was preventing many-to-many relationship data in _links tables from being migrated when the foreign key table was composed of more than one word.

e.g. copying data from the v3 table public_advisory_audits__protected_areas to the v4 table public_advisory_audits_protected_areas_links was failing.

This was happening because relation.modelF contained hyphens and relation.attribute was camel case. In both cases, the values needed to be converted to snake case.

derrickmehaffy commented 6 months ago

looks like we already fixed this here: https://github.com/strapi/migration-scripts/commit/294885f318fe3aca2eff74221623aaa7a9b93944