fixes #2049
This commit is contained in:
21
db/migrate/20140111191413_change_source_index_on_posts.rb
Normal file
21
db/migrate/20140111191413_change_source_index_on_posts.rb
Normal 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
|
||||
Reference in New Issue
Block a user