DEV: Switch to db config to disable advisory locks.

DEV: Switch to db config to disable advisory locks.

diff --git a/app/models/global_setting.rb b/app/models/global_setting.rb
index c32b2b2..1d8df22 100644
--- a/app/models/global_setting.rb
+++ b/app/models/global_setting.rb
@@ -151,6 +151,7 @@ class GlobalSetting
     hash["prepared_statements"] = !!self.db_prepared_statements
     hash["idle_timeout"] = connection_reaper_age if connection_reaper_age.present?
     hash["reaping_frequency"] = connection_reaper_interval if connection_reaper_interval.present?
+    hash["advisory_locks"] = !!self.db_advisory_locks
 
     { "production" => hash }
   end
diff --git a/config/discourse_defaults.conf b/config/discourse_defaults.conf
index b2b2aff..b714d81 100644
--- a/config/discourse_defaults.conf
+++ b/config/discourse_defaults.conf
@@ -59,6 +59,8 @@ db_replica_host =
 # port running replica db server, defaults to 5432 if not set
 db_replica_port =
 
+db_advisory_locks = true
+
 # hostname running the forum
 hostname = "www.example.com"
 
diff --git a/lib/freedom_patches/postgresql_adapter.rb b/lib/freedom_patches/postgresql_adapter.rb
deleted file mode 100644
index c790461..0000000
--- a/lib/freedom_patches/postgresql_adapter.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-# 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

GitHub sha: d8cd9127