DEV Community

dx0x58
dx0x58

Posted on

How to fix Rails ActiveRecord::ConcurrentMigrationError

To correct an ActiveRecord::ConcurrentMigrationError when trying to run Rails databases migrations, you need to:

  1. open psql
  2. Select advisory locks SELECT pid, locktype, mode FROM pg_locks WHERE locktype = 'advisory';
  3. Kill this scoundrels! SELECT pg_terminate_backend(<PID>);

Top comments (2)

Collapse
 
exwarvlad profile image
ZeroCool

Thank you very much!!

Collapse
 
marckohlbrugge profile image
Marc Köhlbrugge

Thanks for sharing! That just saved me a couple of hours figuring out what the hell was happening.