My website uses PostgreSQL and its full-text search. For that to work, I need to execute some configuration queries in order to configure some full-text search extensions.
This is what I have written in a migration file to configure the development database:
class ConfigurePostgresql < ActiveRecord::Migration
def up
execute("CREATE EXTENSION unaccent;")
execute("ALTER TEXT SEARCH DICTIONARY unaccent (RULES='unaccent');")
execute("CREATE TEXT SEARCH CONFIGURATION es ( COPY = spanish );")
execute("ALTER TEXT SEARCH CONFIGURATION es
ALTER MAPPING FOR hword, hword_part, word
WITH unaccent, spanish_stem;")
end
end
This works perfectly in develpment.
Now I want to run some search tests, but when I execute my functional tests, I get an error saying that the extension is not configured:
ActiveRecord::StatementInvalid: PG::Error: ERROR: function unaccent(text) does not exist
Why is not it creating the extension? I have executed rake db:test:prepare
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/aTDph2KTQw8J.
For more options, visit https://groups.google.com/groups/opt_out.