This commit is contained in:
Toks
2014-01-11 14:34:03 -05:00
parent cbe9edfa88
commit 6aedbcdc6e
3 changed files with 31 additions and 10 deletions

View File

@@ -0,0 +1,21 @@
class ChangeSourceIndexOnPosts < ActiveRecord::Migration
def up
execute "set statement_timeout = 0"
execute "DROP INDEX index_posts_on_source"
execute "DROP INDEX index_posts_on_source_pattern"
execute "CREATE INDEX index_posts_on_source ON posts USING btree
(lower(source))"
execute "CREATE INDEX index_posts_on_source_pattern ON posts USING btree
((SourcePattern(lower(source))) text_pattern_ops)"
end
def down
execute "set statement_timeout = 0"
execute "DROP INDEX index_posts_on_source"
execute "DROP INDEX index_posts_on_source_pattern"
execute "CREATE INDEX index_posts_on_source ON posts USING btree
(source)"
execute "CREATE INDEX index_posts_on_source_pattern ON posts USING btree
((SourcePattern(source)) text_pattern_ops)"
end
end