From 337ccfa3a6e54f1b08b2947f17597eadfacbe2fa Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 21 Nov 2017 14:05:09 +0800 Subject: [PATCH] MONKEYPATCH: Allow us to disable the use of advisory locks during migration. --- .../connection_adapters/postgresql_adapter.rb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/active_record/connection_adapters/postgresql_adapter.rb diff --git a/lib/active_record/connection_adapters/postgresql_adapter.rb b/lib/active_record/connection_adapters/postgresql_adapter.rb new file mode 100644 index 00000000000..30cea9f81ea --- /dev/null +++ b/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -0,0 +1,8 @@ +# Awaiting decision on https://github.com/rails/rails/issues/31190 +if ENV['DISABLE_MIGRATION_ADVISORY_LOCK'] + class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter + def supports_advisory_locks? + false + end + end +end