Use AR database_version in PG version checks in migrations (#28804)

This commit is contained in:
Matt Jankowski 2024-01-18 11:11:50 -05:00 committed by GitHub
parent d0b3bc23d7
commit f0b93ab02f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 6 deletions

View file

@ -24,8 +24,7 @@ class CopyAccountStats < ActiveRecord::Migration[5.2]
private
def supports_upsert?
version = select_one("SELECT current_setting('server_version_num') AS v")['v'].to_i
version >= 90_500
ActiveRecord::Base.connection.database_version >= 90_500
end
def up_fast