Add compound index to post_visibilities

This commit is contained in:
Sarah Mei 2011-01-19 00:19:16 -08:00
parent b43c29745b
commit dd3f8f4bee
2 changed files with 11 additions and 1 deletions

View file

@ -0,0 +1,9 @@
class AddIndexToPostVisibilities < ActiveRecord::Migration
def self.up
add_index :post_visibilities, [:aspect_id, :post_id]
end
def self.down
remove_index :post_visibilities, [:aspect_id, :post_id]
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20110105051803) do
ActiveRecord::Schema.define(:version => 20110119060243) do
create_table "aspect_memberships", :force => true do |t|
t.integer "aspect_id"
@ -316,6 +316,7 @@ ActiveRecord::Schema.define(:version => 20110105051803) do
t.datetime "updated_at"
end
add_index "post_visibilities", ["aspect_id", "post_id"], :name => "index_post_visibilities_on_aspect_id_and_post_id"
add_index "post_visibilities", ["aspect_id"], :name => "index_post_visibilities_on_aspect_id"
add_index "post_visibilities", ["post_id"], :name => "index_post_visibilities_on_post_id"