diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-03-12 20:54:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-12 20:54:13 +0100 |
commit | 988f5bf0266483659b03f1b0926d0b9ff9e85a8f (patch) | |
tree | 1e0a0011a890729f45c0d364641c266864e78d02 /lib/tasks/db.rake | |
parent | 2c8bb1745359a3bf200d37383dc56d5951e2b6bc (diff) | |
parent | 8d4b5ee3ef5e8df3a92e19f2c3f3a4560341eef3 (diff) |
Merge pull request #1716 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'lib/tasks/db.rake')
-rw-r--r-- | lib/tasks/db.rake | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index a6b8c74cd..ca939fd1f 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -17,23 +17,10 @@ namespace :db do end end - task :post_migration_hook do - at_exit do - unless %w(C POSIX).include?(ActiveRecord::Base.connection.select_one('SELECT datcollate FROM pg_database WHERE datname = current_database();')['datcollate']) - warn <<~WARNING - Your database collation may be susceptible to index corruption. - (This warning does not indicate that index corruption has occurred, and it can be ignored if you've previously checked for index corruption) - (To learn more, visit: https://docs.joinmastodon.org/admin/troubleshooting/index-corruption/) - WARNING - end - end - end - task :pre_migration_check do version = ActiveRecord::Base.connection.select_one("SELECT current_setting('server_version_num') AS v")['v'].to_i - abort 'ERROR: 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 9.5 or newer. Please update PostgreSQL before updating Mastodon' if version < 90_500 end Rake::Task['db:migrate'].enhance(['db:pre_migration_check']) - Rake::Task['db:migrate'].enhance(['db:post_migration_hook']) end |