diff --git a/db/migrate/20110119165820_add_creator_index_to_choices.rb b/db/migrate/20110119165820_add_creator_index_to_choices.rb new file mode 100644 index 0000000..7ef880c --- /dev/null +++ b/db/migrate/20110119165820_add_creator_index_to_choices.rb @@ -0,0 +1,9 @@ +class AddCreatorIndexToChoices < ActiveRecord::Migration + def self.up + add_index :choices, :creator_id + end + + def self.down + remove_index :choices, :creator_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 87d973a..b093bee 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -9,7 +9,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20101221143936) do +ActiveRecord::Schema.define(:version => 20110119165820) do create_table "appearances", :force => true do |t| t.integer "voter_id" @@ -50,6 +50,7 @@ ActiveRecord::Schema.define(:version => 20101221143936) do t.integer "creator_id" end + add_index "choices", ["creator_id"], :name => "index_choices_on_creator_id" add_index "choices", ["question_id", "score"], :name => "index_choices_on_question_id_and_score" create_table "clicks", :force => true do |t| @@ -134,6 +135,7 @@ ActiveRecord::Schema.define(:version => 20101221143936) do t.integer "votes_count", :default => 0 end + add_index "prompts", ["id", "question_id", "left_choice_id", "right_choice_id"], :name => "index_foo" add_index "prompts", ["left_choice_id", "right_choice_id", "question_id"], :name => "a_cool_index", :unique => true add_index "prompts", ["left_choice_id"], :name => "index_prompts_on_left_choice_id" add_index "prompts", ["question_id"], :name => "index_prompts_on_question_id" -- libgit2 0.21.2