Rails 5 db migration: how to fix ActiveRecord::ConcurrentMigrationError

后端 未结 4 1560
星月不相逢
星月不相逢 2021-01-07 18:36

A previous rake db:rollback stalled. Now when attempting a new migration we get the following error:

rake aborted!
ActiveRecord::ConcurrentMigrationError: 

         


        
4条回答
  •  孤城傲影
    2021-01-07 19:23

    For me it was resolved in this way:

    Select advisory locks:

    SELECT pid, locktype, mode FROM pg_locks WHERE locktype = 'advisory';
    
    SELECT pg_terminate_backend();
    

提交回复
热议问题