Skip to content

Commit 231a18a

Browse files
committed
Merge pull request #360 from icarito/master
Add index to tag_id field in snapshots table to help performance.
2 parents 54538db + eaa5d15 commit 231a18a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class AddIndexToSnapshots < ActiveRecord::Migration
2+
def change
3+
add_index :snapshots, :tag_id
4+
end
5+
end

db/schema.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212
# It's strongly recommended to check this file into your version control system.
1313

14-
ActiveRecord::Schema.define(:version => 20151202002150) do
14+
ActiveRecord::Schema.define(:version => 20160421084510) do
1515

1616
create_table "comments", :force => true do |t|
1717
t.string "author"
@@ -674,6 +674,8 @@
674674
t.datetime "updated_at", :null => false
675675
end
676676

677+
add_index "snapshots", ["tag_id"], :name => "index_snapshots_on_tag_id"
678+
677679
create_table "spectra_sets", :force => true do |t|
678680
t.string "title", :default => "", :null => false
679681
t.string "author", :default => "", :null => false

0 commit comments

Comments
 (0)