]> cat aescling's git repositories - mastodon.git/commitdiff
Fix post-migration warning about index corruption being too scary (#15223)
authorEugen Rochko <eugen@zeonfederated.com>
Fri, 27 Nov 2020 14:41:43 +0000 (15:41 +0100)
committerGitHub <noreply@github.com>
Fri, 27 Nov 2020 14:41:43 +0000 (15:41 +0100)
lib/tasks/db.rake

index 199155107b18b4e31fb635bad82cf2ff8e578c96..f6c9c7eecfc21f5415447e1edf390674b2ed64bc 100644 (file)
@@ -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