Sha256: ffef5c25bbacc3a520d625b6f94f9cca7455f7a7cdfc181c15fc626d53940940
Contents?: true
Size: 1 KB
Versions: 28
Compression:
Stored size: 1 KB
Contents
# frozen_string_literal: true class CreateSearchConfigurations < ActiveRecord::Migration[5.2] def up dictionaries.each do |dict| stem = dict == "simple" ? "simple" : "#{dict}_stem" ActiveRecord::Base.connection.execute <<-SQL.squish DROP TEXT SEARCH CONFIGURATION IF EXISTS #{dict}_unaccent; CREATE TEXT SEARCH CONFIGURATION #{dict}_unaccent (COPY = pg_catalog.#{dict}); ALTER TEXT SEARCH CONFIGURATION #{dict}_unaccent ALTER MAPPING FOR hword, hword_part, word WITH unaccent, #{stem}; SQL end end def down dictionaries.each do |dict| ActiveRecord::Base.connection.execute <<-SQL.squish DROP TEXT SEARCH CONFIGURATION IF EXISTS #{dict}_unaccent; SQL end end private def dictionaries %w[arabic danish dutch english finnish french german hungarian indonesian irish italian lithuanian nepali norwegian portuguese romanian russian spanish swedish tamil turkish simple] end end
Version data entries
28 entries across 28 versions & 1 rubygems