How do I cancel a running migration?
Stop and then restart the database again. Then try rails db:migrate
again.
If you are using posgresql installed with 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
If you are using postgresql in linux based system, you can use below command to restart the database. Then run your migrations again.
/etc/init.d/postgresql restart