Permalink
Browse files

adding indexes

  • Loading branch information...
1 parent 2f0a4b1 commit 48ba11cf7b73caa7a5360213c3f65e0eda70387d @ryanb committed Oct 17, 2010
Showing with 17 additions and 0 deletions.
  1. +17 −0 db/migrate/20101017234019_add_indexes.rb
View
17 db/migrate/20101017234019_add_indexes.rb
@@ -0,0 +1,17 @@
+class AddIndexes < ActiveRecord::Migration
+ def self.up
+ add_index :authentications, :user_id
+ add_index :games, :black_player_id
+ add_index :games, :white_player_id
+ add_index :games, :current_player_id
+ add_index :games, [:id, :current_player_id, :finished_at]
+ end
+
+ def self.down
+ remove_index :authentications, :user_id
+ remove_index :games, :black_player_id
+ remove_index :games, :white_player_id
+ remove_index :games, :current_player_id
+ remove_index :games, :column => [:id, :current_player_id, :finished_at]
+ end
+end

0 comments on commit 48ba11c

Please sign in to comment.