From f47c2f619336d41096b4df34e6dfc73e9d4b100e Mon Sep 17 00:00:00 2001 From: Daniel Cunha Date: Fri, 11 Jan 2013 20:33:41 -0300 Subject: [PATCH] Aggressive Indexing Strategy 3 --- db/migrate/20130111232201_aggressive_indexing_strategy3.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+), 0 deletions(-) create mode 100644 db/migrate/20130111232201_aggressive_indexing_strategy3.rb diff --git a/db/migrate/20130111232201_aggressive_indexing_strategy3.rb b/db/migrate/20130111232201_aggressive_indexing_strategy3.rb new file mode 100644 index 0000000..1370e76 --- /dev/null +++ b/db/migrate/20130111232201_aggressive_indexing_strategy3.rb @@ -0,0 +1,23 @@ +class AggressiveIndexingStrategy3 < ActiveRecord::Migration + def self.up + add_index :articles, :slug + add_index :articles, :parent_id + add_index :articles, :profile_id + add_index :articles, :translation_of_id + + add_index :article_versions, :article_id + + add_index :comments, [:source_id, :spam] + end + + def self.down + remove_index :articles, :slug + remove_index :articles, :parent_id + remove_index :articles, :profile_id + remove_index :articles, :translation_of_id + + remove_index :article_versions, :article_id + + remove_index :comments, [:source_id, :spam] + end +end -- libgit2 0.21.2