Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding indexes

  • Loading branch information...
commit 48ba11cf7b73caa7a5360213c3f65e0eda70387d 1 parent 2f0a4b1
Ryan Bates authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 db/migrate/20101017234019_add_indexes.rb
17 db/migrate/20101017234019_add_indexes.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.