Sha256: 9b68fc1d96428532f53a6893a19cbfcdb9292b64240b3d9121aaeeb9c0ea2c06

Contents?: true

Size: 733 Bytes

Versions: 8

Compression:

Stored size: 733 Bytes

Contents

class AddPgSearchDmetaphoneSupportFunctions < ActiveRecord::Migration
  def self.up
    say_with_time("Adding support functions for pg_search :dmetaphone") do
      if ActiveRecord::Base.connection.send(:postgresql_version) < 80400
        execute <<-SQL
<%= read_sql_file "unnest" %>
        SQL
      end

      execute <<-SQL
<%= read_sql_file "dmetaphone" %>
      SQL
    end
  end

  def self.down
    say_with_time("Dropping support functions for pg_search :dmetaphone") do
      execute <<-SQL
<%= read_sql_file "uninstall_dmetaphone" %>
      SQL

      if ActiveRecord::Base.connection.send(:postgresql_version) < 80400
        execute <<-SQL
<%= read_sql_file "uninstall_unnest" %>
        SQL
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pg_search-0.5.7 lib/pg_search/migration/templates/add_pg_search_dmetaphone_support_functions.rb.erb
pg_search-0.5.6 lib/pg_search/migration/templates/add_pg_search_dmetaphone_support_functions.rb.erb
pg_search-0.5.5 lib/pg_search/migration/templates/add_pg_search_dmetaphone_support_functions.rb.erb
pg_search-0.5.4 lib/pg_search/migration/templates/add_pg_search_dmetaphone_support_functions.rb.erb
pg_search-0.5.3 lib/pg_search/migration/templates/add_pg_search_dmetaphone_support_functions.rb.erb
pg_search-0.5.2 lib/pg_search/migration/templates/add_pg_search_dmetaphone_support_functions.rb.erb
pg_search-0.5.1 lib/pg_search/migration/templates/add_pg_search_dmetaphone_support_functions.rb.erb
pg_search-0.5 lib/pg_search/migration/templates/add_pg_search_dmetaphone_support_functions.rb.erb