Home > OS >  Rails - All test database opertaions hanging
Rails - All test database opertaions hanging

Time:06-20

I was running a small migration to the test database (already run fine on local database), when it hung up. I terminated the process, and tried to re-run, I keep getting the error:

Cannot run migrations because another migration process is currently running.

So I try to reset the database, by running rails db:reset RAILS_ENV=test, but this again keeps running and giving no response. Desperate I thus try dropping and rebuilding the database, by first rails db:drop RAILS_ENV=test that again runs forever and gives no response.

How can I get the migration to run normally again?

CodePudding user response:

You can try restarting the test database to clear any connections.

Depending on the platform you're using:

brew services restart mysql

or

docker-compose restart mysql
  • Related