Commit 64b1b297e9972504ab12f6ce4652eb23473797f3

Authored by Rodrigo Souto
1 parent 7b76f317

Index published to improve blog posts fetch

db/migrate/20140724180943_add_index_to_blog_posts_sort.rb 0 → 100644
... ... @@ -0,0 +1,13 @@
  1 +class AddIndexToBlogPostsSort < ActiveRecord::Migration
  2 + def self.up
  3 + %w[articles article_versions].each do |table|
  4 + add_index table, [:published_at, :id]
  5 + end
  6 + end
  7 +
  8 + def self.down
  9 + %w[articles article_versions].each do |table|
  10 + remove_index table, [:published_at, :id]
  11 + end
  12 + end
  13 +end
... ...