Commit 0d240c01b73984b61922c12d192a52b41eaf8e55
1 parent
d90fe8cd
Exists in
master
and in
1 other branch
update an index on appearances by add / del
add index on appearances (question_id, voter_id) remove index on appearances (question_id) as it is now superseded by the former
Showing
3 changed files
with
20 additions
and
2 deletions
Show diff stats
db/migrate/20110120202304_add_voter_id_index_on_appearances.rb
0 → 100644
| @@ -0,0 +1,9 @@ | @@ -0,0 +1,9 @@ | ||
| 1 | +class AddVoterIdIndexOnAppearances < ActiveRecord::Migration | ||
| 2 | + def self.up | ||
| 3 | + add_index :appearances, [:question_id, :voter_id], :name => 'index_appearances_on_question_id_voter_id' | ||
| 4 | + end | ||
| 5 | + | ||
| 6 | + def self.down | ||
| 7 | + remove_index :appearances, :name => :index_appearances_on_question_id_voter_id | ||
| 8 | + end | ||
| 9 | +end |
db/migrate/20110120204933_remove_question_id_index_on_appearances.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 => 20110119165820) do | 12 | +ActiveRecord::Schema.define(:version => 20110120204933) 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" |
| @@ -26,7 +26,7 @@ ActiveRecord::Schema.define(:version => 20110119165820) do | @@ -26,7 +26,7 @@ ActiveRecord::Schema.define(:version => 20110119165820) do | ||
| 26 | end | 26 | end |
| 27 | 27 | ||
| 28 | add_index "appearances", ["lookup"], :name => "index_appearances_on_lookup" | 28 | add_index "appearances", ["lookup"], :name => "index_appearances_on_lookup" |
| 29 | - add_index "appearances", ["question_id"], :name => "index_appearances_on_question_id" | 29 | + add_index "appearances", ["question_id", "voter_id"], :name => "index_appearances_on_question_id_voter_id" |
| 30 | 30 | ||
| 31 | create_table "choices", :force => true do |t| | 31 | create_table "choices", :force => true do |t| |
| 32 | t.integer "item_id" | 32 | t.integer "item_id" |