From c96b617bf680d9a3a39f6522a0835d5f0db07b04 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 6 May 2019 16:59:09 +0800 Subject: [PATCH] FIX: Don't trigger PG failover when running `db:migrate`. --- .../connection_adapters/postgresql_fallback_adapter.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb index f76d921cb58..186b342814a 100644 --- a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb +++ b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb @@ -138,6 +138,7 @@ end module ActiveRecord module ConnectionHandling def postgresql_fallback_connection(config) + return postgresql_connection(config) if ARGV.include?("db:migrate") fallback_handler = ::PostgreSQLFallbackHandler.instance config = config.symbolize_keys