Not to be exactly your problem but mine was the order of migration files. I renamed the migration files so the first one was the foreign table and the second one was the main table. As below:
migrations/xxxxxxxxxxxxx1-create-userstatus.js
migrations/xxxxxxxxxxxxx2-create-users.js
and when I ran the db:migrate
, everything was successful.