Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit

Permalink
Enable PGroonga
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Nov 9, 2015
1 parent 9ff87d6 commit 3d5d43e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions db/migrate/20151109091221_enable_p_groonga.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
class EnablePGroonga < ActiveRecord::Migration
def change
reversible do |r|
current_database = select_value("SELECT current_database()")

r.up do
enable_extension("pgroonga")
execute("ALTER DATABASE #{current_database} " +
"SET search_path = '$user',public,pgroonga,pg_catalog;")
end

r.down do
execute("ALTER DATABASE #{current_database} RESET search_path;")
disable_extensioin("pgroonga")
end
end
end
end

0 comments on commit 3d5d43e

Please sign in to comment.