DEV Community

dx0x58
dx0x58

Posted on

5 1

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.

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay