Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Fix post-migration warning about index corruption being too scary (ma…
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron authored Nov 27, 2020
1 parent 1e89e2e commit ec0edf7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/tasks/db.rake
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ namespace :db do
task :post_migration_hook do
at_exit do
unless %w(C POSIX).include?(ActiveRecord::Base.connection.execute('SELECT datcollate FROM pg_database WHERE datname = current_database();').first['datcollate'])
Rails.logger.warn 'WARNING: Your database is using an unsafe collation setting, which might result in index corruption.'
Rails.logger.warn 'WARNING: See https://docs.joinmastodon.org/admin/troubleshooting/index-corruption/#am-i-affected'
warn <<~WARNING
Your database collation is susceptible to index corruption.
(This warning does not indicate that index corruption has occured and can be ignored)
(To learn more, visit: https://docs.joinmastodon.org/admin/troubleshooting/index-corruption/)
WARNING
end
end
end
Expand Down

0 comments on commit ec0edf7

Please sign in to comment.