1
0
Fork 1
forked from fedi/mastodon

Change PostgreSQL version check to check for PostgreSQL 10+

This commit is contained in:
Claire 2024-01-24 14:59:09 +01:00
parent 4eb98ef755
commit 1ab050eb52

View file

@ -17,7 +17,7 @@ namespace :db do
task :pre_migration_check do task :pre_migration_check do
version = ActiveRecord::Base.connection.select_one("SELECT current_setting('server_version_num') AS v")['v'].to_i 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 abort 'This version of Mastodon requires PostgreSQL 10.0 or newer. Please update PostgreSQL before updating Mastodon' if version < 100_000
end end
Rake::Task['db:migrate'].enhance(['db:pre_migration_check']) Rake::Task['db:migrate'].enhance(['db:pre_migration_check'])