add indexes to relations

This commit is contained in:
Alexander Machehin 2013-07-17 17:33:34 +06:00
parent e0f247ac1e
commit 334fe35b1a
2 changed files with 10 additions and 1 deletions

View File

@ -0,0 +1,6 @@
class AddIndexToRelation < ActiveRecord::Migration
def change
add_index :relations, [:actor_type, :actor_id]
add_index :relations, [:target_type, :target_id]
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20130701121313) do
ActiveRecord::Schema.define(:version => 20130717112337) do
create_table "activity_feeds", :force => true do |t|
t.integer "user_id", :null => false
@ -450,6 +450,9 @@ ActiveRecord::Schema.define(:version => 20130701121313) do
t.string "role"
end
add_index "relations", ["actor_type", "actor_id"], :name => "index_relations_on_actor_type_and_actor_id"
add_index "relations", ["target_type", "target_id"], :name => "index_relations_on_target_type_and_target_id"
create_table "repositories", :force => true do |t|
t.string "description", :null => false
t.integer "platform_id", :null => false