diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index 3bc526bd21a..4208c2ae4b5 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -16,8 +16,8 @@ namespace :db do end task pre_migration_check: :environment do - version = ActiveRecord::Base.connection.select_one("SELECT current_setting('server_version_num') AS v")['v'].to_i - abort 'This version of Mastodon requires PostgreSQL 9.5 or newer. Please update PostgreSQL before updating Mastodon' if version < 90_500 + version = ActiveRecord::Base.connection.database_version + abort 'This version of Mastodon requires PostgreSQL 12.0 or newer. Please update PostgreSQL before updating Mastodon.' if version < 120_000 end Rake::Task['db:migrate'].enhance(['db:pre_migration_check'])