More detailed trigram migration error message

This explains the user what they need to run and where to go in case
they want to learn more about "CREATE EXTENSION".
This commit is contained in:
Yorick Peterse 2016-03-10 14:49:15 +01:00 committed by Robert Speicher
parent 4f3fa519c6
commit 67143e25a2
1 changed files with 4 additions and 1 deletions

View File

@ -5,7 +5,10 @@ class AddTrigramIndexesForSearching < ActiveRecord::Migration
return unless Gitlab::Database.postgresql?
unless trigrams_enabled?
raise 'You must enable the pg_trgm extension as a PostgreSQL super user'
raise 'You must enable the pg_trgm extension. You can do so by running ' \
'"CREATE EXTENSION pg_trgm;" as a PostgreSQL super user, this must be ' \
'done for every GitLab database. For more information see ' \
'http://www.postgresql.org/docs/current/static/sql-createextension.html'
end
# trigram indexes are case-insensitive so we can just index the column