How to undo the current migration

ruby on railsI started in the application rails db:migrate, and for some reason the migration was hanging. I had to kill the terminal tab in which the migration was performed. When I tried to run rails db:migratein a new tab, I received this error message:

Cannot run migrations because another migration process is currently running

How to fix it?

+4
source share
1 answer

Stop and restart the database. Then try again rails db:migrate.

If you are using posgresql installed using homebrew on Mac OSX, the following stops / restarts the database:

pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
pg_ctl -D /usr/local/var/postgres stop -s -m fast
+3
source

Source: https://habr.com/ru/post/1675432/


All Articles