Commit 4c7f9366213a76453e77a39951e5b0feec239f9b
1 parent
e532eb9b
Exists in
master
and in
1 other branch
add index on choices.creator_id
Showing
2 changed files
with
12 additions
and
1 deletions
Show diff stats
db/migrate/20110119165820_add_creator_index_to_choices.rb
0 → 100644
db/schema.rb
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | # | 9 | # |
| 10 | # It's strongly recommended to check this file into your version control system. | 10 | # It's strongly recommended to check this file into your version control system. |
| 11 | 11 | ||
| 12 | -ActiveRecord::Schema.define(:version => 20101221143936) do | 12 | +ActiveRecord::Schema.define(:version => 20110119165820) do |
| 13 | 13 | ||
| 14 | create_table "appearances", :force => true do |t| | 14 | create_table "appearances", :force => true do |t| |
| 15 | t.integer "voter_id" | 15 | t.integer "voter_id" |
| @@ -50,6 +50,7 @@ ActiveRecord::Schema.define(:version => 20101221143936) do | @@ -50,6 +50,7 @@ ActiveRecord::Schema.define(:version => 20101221143936) do | ||
| 50 | t.integer "creator_id" | 50 | t.integer "creator_id" |
| 51 | end | 51 | end |
| 52 | 52 | ||
| 53 | + add_index "choices", ["creator_id"], :name => "index_choices_on_creator_id" | ||
| 53 | add_index "choices", ["question_id", "score"], :name => "index_choices_on_question_id_and_score" | 54 | add_index "choices", ["question_id", "score"], :name => "index_choices_on_question_id_and_score" |
| 54 | 55 | ||
| 55 | create_table "clicks", :force => true do |t| | 56 | create_table "clicks", :force => true do |t| |
| @@ -134,6 +135,7 @@ ActiveRecord::Schema.define(:version => 20101221143936) do | @@ -134,6 +135,7 @@ ActiveRecord::Schema.define(:version => 20101221143936) do | ||
| 134 | t.integer "votes_count", :default => 0 | 135 | t.integer "votes_count", :default => 0 |
| 135 | end | 136 | end |
| 136 | 137 | ||
| 138 | + add_index "prompts", ["id", "question_id", "left_choice_id", "right_choice_id"], :name => "index_foo" | ||
| 137 | add_index "prompts", ["left_choice_id", "right_choice_id", "question_id"], :name => "a_cool_index", :unique => true | 139 | add_index "prompts", ["left_choice_id", "right_choice_id", "question_id"], :name => "a_cool_index", :unique => true |
| 138 | add_index "prompts", ["left_choice_id"], :name => "index_prompts_on_left_choice_id" | 140 | add_index "prompts", ["left_choice_id"], :name => "index_prompts_on_left_choice_id" |
| 139 | add_index "prompts", ["question_id"], :name => "index_prompts_on_question_id" | 141 | add_index "prompts", ["question_id"], :name => "index_prompts_on_question_id" |