Commit e46dab1ac5770e436b6088cb893060b09f2559b4

Authored by Valery Sizov
1 parent 744814c5

add db indexes

db/migrate/20120119202326_add_indexes.rb 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +class AddIndexes < ActiveRecord::Migration
  2 + def change
  3 + add_index :issues, :project_id
  4 + add_index :merge_requests, :project_id
  5 + add_index :notes, :noteable_id
  6 + add_index :notes, :noteable_type
  7 + end
  8 +
  9 +end
... ...
db/schema.rb
... ... @@ -11,7 +11,7 @@
11 11 #
12 12 # It's strongly recommended to check this file into your version control system.
13 13  
14   -ActiveRecord::Schema.define(:version => 20120110180749) do
  14 +ActiveRecord::Schema.define(:version => 20120119202326) do
15 15  
16 16 create_table "issues", :force => true do |t|
17 17 t.string "title"
... ... @@ -26,6 +26,8 @@ ActiveRecord::Schema.define(:version =&gt; 20120110180749) do
26 26 t.string "branch_name"
27 27 end
28 28  
  29 + add_index "issues", ["project_id"], :name => "index_issues_on_project_id"
  30 +
29 31 create_table "keys", :force => true do |t|
30 32 t.integer "user_id"
31 33 t.datetime "created_at"
... ... @@ -48,6 +50,8 @@ ActiveRecord::Schema.define(:version =&gt; 20120110180749) do
48 50 t.datetime "updated_at"
49 51 end
50 52  
  53 + add_index "merge_requests", ["project_id"], :name => "index_merge_requests_on_project_id"
  54 +
51 55 create_table "notes", :force => true do |t|
52 56 t.text "note"
53 57 t.string "noteable_id"
... ... @@ -60,6 +64,9 @@ ActiveRecord::Schema.define(:version =&gt; 20120110180749) do
60 64 t.string "line_code"
61 65 end
62 66  
  67 + add_index "notes", ["noteable_id"], :name => "index_notes_on_noteable_id"
  68 + add_index "notes", ["noteable_type"], :name => "index_notes_on_noteable_type"
  69 +
63 70 create_table "projects", :force => true do |t|
64 71 t.string "name"
65 72 t.string "path"
... ...