Update pre_migration_check postgres version requirement (#28800)

pull/28822/head
Matt Jankowski 2024-01-19 06:20:20 -05:00 committed by GitHub
parent 9cd17020bc
commit 6a5d70e146
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

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