added the missing tag followings indecies

This commit is contained in:
Ilya Zhitomirskiy 2011-10-26 13:40:01 -07:00
parent db3e411978
commit 162d3ccd10
2 changed files with 18 additions and 1 deletions

View file

@ -0,0 +1,13 @@
class AddMissingTagFollowingsIndices < ActiveRecord::Migration
def self.up
add_index :tag_followings, :tag_id
add_index :tag_followings, :user_id
add_index :tag_followings, [:tag_id, :user_id], :unique => true
end
def self.down
remove_index :tag_followings, :column => [:tag_id, :user_id]
remove_index :tag_followings, :column => :user_id
remove_index :tag_followings, :column => :tag_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 => 20111023230730) do
ActiveRecord::Schema.define(:version => 20111026173547) do
create_table "aspect_memberships", :force => true do |t|
t.integer "aspect_id", :null => false
@ -385,6 +385,10 @@ ActiveRecord::Schema.define(:version => 20111023230730) do
t.datetime "updated_at"
end
add_index "tag_followings", ["tag_id", "user_id"], :name => "index_tag_followings_on_tag_id_and_user_id", :unique => true
add_index "tag_followings", ["tag_id"], :name => "index_tag_followings_on_tag_id"
add_index "tag_followings", ["user_id"], :name => "index_tag_followings_on_user_id"
create_table "taggings", :force => true do |t|
t.integer "tag_id"
t.integer "taggable_id"