strapi / migration-scripts

Collection of Strapi Migration scripts
58 stars 57 forks source link

Migration script fails on relationships #117

Closed tim9009 closed 9 months ago

tim9009 commented 9 months ago

Bug report

Required System information

Describe the bug

When running the migration script the script exits with an error every time it is about to migrate a table that includes an id, for example: Key (page_id)=(9) is not present in table "pages".. When looking at the rows in the pages table of the source database I can confirm that the page with id 9 does exist.

Screenshots

screenshot

lukaszewczak commented 9 months ago

@tim9009 I had the same issue, but I didn't notice the first message in the console Error setting session_replication_role to replica, you may get foreign key constraint errors. After running migration with users who have correct permissions migration works.

tim9009 commented 9 months ago

Thank you for pointing that out @lukaszewczak! I ran the migration as a superuser and that allowed the script to finish with no errors 🎉

derrickmehaffy commented 9 months ago

Will close this one as solved :)