Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Commit

Permalink
adding index on annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Trautmann committed Jan 12, 2012
1 parent d56db29 commit fd59603
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions db/migrate/20120112010455_add_index_for_annotations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class AddIndexForAnnotations < ActiveRecord::Migration
def self.up
add_index :annotations, [:container_id, :container_type]
end

def self.down
remove_index :annotations, [:container_id, :container_type]
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20120112005028) do
ActiveRecord::Schema.define(:version => 20120112010455) do

create_table "annotations", :force => true do |t|
t.integer "container_id"
Expand All @@ -19,6 +19,7 @@
t.string "container_type"
end

add_index "annotations", ["container_id", "container_type"], :name => "index_annotations_on_container_id_and_container_type"
add_index "annotations", ["container_id"], :name => "index_annotation_on_instantiation_id"

create_table "asset_date_types", :force => true do |t|
Expand Down

0 comments on commit fd59603

Please sign in to comment.