summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2012-01-19 22:31:34 +0200
committerValery Sizov <vsv2711@gmail.com>2012-01-19 22:54:22 +0200
commite46dab1ac5770e436b6088cb893060b09f2559b4 (patch)
tree45ccfe46136a89309ff749405037a0bbf5100751
parent744814c509a1dc51bb8756fa15e695e2110dec7c (diff)
downloadgitlab-ce-e46dab1ac5770e436b6088cb893060b09f2559b4.tar.gz
add db indexes
-rw-r--r--db/migrate/20120119202326_add_indexes.rb9
-rw-r--r--db/schema.rb9
2 files changed, 17 insertions, 1 deletions
diff --git a/db/migrate/20120119202326_add_indexes.rb b/db/migrate/20120119202326_add_indexes.rb
new file mode 100644
index 00000000000..ee07176a267
--- /dev/null
+++ b/db/migrate/20120119202326_add_indexes.rb
@@ -0,0 +1,9 @@
+class AddIndexes < ActiveRecord::Migration
+ def change
+ add_index :issues, :project_id
+ add_index :merge_requests, :project_id
+ add_index :notes, :noteable_id
+ add_index :notes, :noteable_type
+ end
+
+end
diff --git a/db/schema.rb b/db/schema.rb
index 5fbb013b7dd..7290df2b34f 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120110180749) do
+ActiveRecord::Schema.define(:version => 20120119202326) do
create_table "issues", :force => true do |t|
t.string "title"
@@ -26,6 +26,8 @@ ActiveRecord::Schema.define(:version => 20120110180749) do
t.string "branch_name"
end
+ add_index "issues", ["project_id"], :name => "index_issues_on_project_id"
+
create_table "keys", :force => true do |t|
t.integer "user_id"
t.datetime "created_at"
@@ -48,6 +50,8 @@ ActiveRecord::Schema.define(:version => 20120110180749) do
t.datetime "updated_at"
end
+ add_index "merge_requests", ["project_id"], :name => "index_merge_requests_on_project_id"
+
create_table "notes", :force => true do |t|
t.text "note"
t.string "noteable_id"
@@ -60,6 +64,9 @@ ActiveRecord::Schema.define(:version => 20120110180749) do
t.string "line_code"
end
+ add_index "notes", ["noteable_id"], :name => "index_notes_on_noteable_id"
+ add_index "notes", ["noteable_type"], :name => "index_notes_on_noteable_type"
+
create_table "projects", :force => true do |t|
t.string "name"
t.string "path"