beast rev 2066
[beast-modified.git] / db / migrate / 043_index_happy.rb
blobf32b5de47664bb1b13dbf08ca1ff5981726b5831
1 class IndexHappy < ActiveRecord::Migration
2   def self.up
3     remove_index :posts, :name => :index_posts_on_topic_id
4     add_index :posts, [:forum_id, :created_at], :name => :index_posts_on_forum_id
5     add_index :users, :last_seen_at, :name => :index_users_on_last_seen_at
6     add_index :moderatorships, :forum_id, :name => :index_moderatorships_on_forum_id
7   end
9   def self.down
10     remove_index :posts, :name => :index_posts_on_forum_id
11     remove_index :users, :name => :index_users_on_last_seen_at
12     remove_index :moderatorships, :name => :index_moderatorships_on_forum_id
13     add_index :posts, [:topic_id, :created_at], :name => :index_posts_on_topic_id
14   end
15 end