This commit is contained in:
albert
2013-03-31 21:36:44 -04:00
parent 9dabc2db67
commit fb7b82d60a
2 changed files with 12 additions and 1 deletions

View File

@@ -118,7 +118,7 @@ class PostQueryBuilder
relation = add_range_relation(q[:height], "posts.image_height", relation)
relation = add_range_relation(q[:score], "posts.score", relation)
relation = add_range_relation(q[:filesize], "posts.file_size", relation)
relation = add_range_relation(q[:date], "date(posts.created_at)", relation)
relation = add_range_relation(q[:date], "posts.created_at", relation)
relation = add_range_relation(q[:general_tag_count], "posts.tag_count_general", relation)
relation = add_range_relation(q[:artist_tag_count], "posts.tag_count_artist", relation)
relation = add_range_relation(q[:copyright_tag_count], "posts.tag_count_copyright", relation)

View File

@@ -0,0 +1,11 @@
class DropIndexPostsOnCreatedAtDate < ActiveRecord::Migration
def up
execute "set statement_timeout = 0"
execute "drop index index_posts_on_created_at_date"
end
def down
execute "set statement_timeout = 0"
execute "create index index_posts_on_created_at_date on posts(date(created_at))"
end
end