Skip to content

Commit

Permalink
multi-key index
Browse files Browse the repository at this point in the history
  • Loading branch information
mhartl committed Sep 16, 2011
1 parent 8c6ca9b commit 65dac0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions db/migrate/20100829210229_create_microposts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ def self.up

t.timestamps
end
add_index :microposts, :user_id
add_index :microposts, :created_at
add_index :microposts, [:user_id, :created_at]
end

def self.down
Expand Down
3 changes: 1 addition & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
t.datetime "updated_at"
end

add_index "microposts", ["created_at"], :name => "index_microposts_on_created_at"
add_index "microposts", ["user_id"], :name => "index_microposts_on_user_id"
add_index "microposts", ["user_id", "created_at"], :name => "index_microposts_on_user_id_and_created_at"

create_table "relationships", :force => true do |t|
t.integer "follower_id"
Expand Down

0 comments on commit 65dac0c

Please sign in to comment.