strapi / codemods

A set of scripts to help migrate Strapi plugins (and in some cases Strapi applications) from v3 to v4
44 stars 13 forks source link

Fix UP extensions conversion #48

Closed derrickmehaffy closed 1 year ago

derrickmehaffy commented 1 year ago

fixes #47

We have to handle users-permissions plugin extensions differently than normal since we renamed the models in v4. The collectionName wasn't being updated. This PR specifically checks for that and uses replace + pluralize to convert to the proper name.

markkaylor commented 1 year ago

Hey Derrick, this PR is probably good to go but I'm actually not sure I understand how to test it. Could provide steps for how to test?

derrickmehaffy commented 1 year ago

Basically create the v3 app but add some extra field (regular and relation), we just need to confirm that when codemods moves the extended model file and converts it to a content-type it updates the collectionName to use the up_ prefix syntax in v4 and not the legacy users-permissions_ prefix which was breaking several relations and caused quite a lot of issues in the data migration scripts