summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Sørensen <johan@johansorensen.com>2009-12-07 14:41:20 +0100
committerJohan Sørensen <johan@johansorensen.com>2009-12-07 14:41:20 +0100
commitf26d181314683f222bca6c21f55cb18f694d2d45 (patch)
tree80c1b6207600dce5bf772f0a211433ec729e383f
parentbdcf1baeaa27a699fb219c004b0868eb244e7269 (diff)
downloadgitorious-mainline-outdated-f26d181314683f222bca6c21f55cb18f694d2d45.zip
gitorious-mainline-outdated-f26d181314683f222bca6c21f55cb18f694d2d45.tar.gz
gitorious-mainline-outdated-f26d181314683f222bca6c21f55cb18f694d2d45.tar.bz2
Add index to the favorites table
-rw-r--r--db/migrate/20091207133046_add_indices_to_favorites.rb9
-rw-r--r--db/schema.rb17
2 files changed, 24 insertions, 2 deletions
diff --git a/db/migrate/20091207133046_add_indices_to_favorites.rb b/db/migrate/20091207133046_add_indices_to_favorites.rb
new file mode 100644
index 0000000..d0e9d36
--- /dev/null
+++ b/db/migrate/20091207133046_add_indices_to_favorites.rb
@@ -0,0 +1,9 @@
+class AddIndicesToFavorites < ActiveRecord::Migration
+ def self.up
+ add_index :favorites, [:watchable_type, :watchable_id, :user_id]
+ end
+
+ def self.down
+ remove_index :favorites, [:watchable_type, :watchable_id, :user_id]
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index f86b4bb..6af5072 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1,4 +1,4 @@
-# This file is auto-generated from the current state of the database. Instead of editing this file,
+# This file is auto-generated from the current state of the database. Instead of editing this file,
# please use the migrations feature of Active Record to incrementally modify your database, and
# then regenerate this schema definition.
#
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20091125143413) do
+ActiveRecord::Schema.define(:version => 20091207133046) do
create_table "cloners", :force => true do |t|
t.string "ip"
@@ -104,6 +104,8 @@ ActiveRecord::Schema.define(:version => 20091125143413) do
t.datetime "updated_at"
end
+ add_index "favorites", ["watchable_type", "watchable_id", "user_id"], :name => "index_favorites_on_watchable_type_and_watchable_id_and_user_id"
+
create_table "groups", :force => true do |t|
t.string "name"
t.integer "user_id"
@@ -119,6 +121,17 @@ ActiveRecord::Schema.define(:version => 20091125143413) do
add_index "groups", ["name"], :name => "index_groups_on_name_and_public"
add_index "groups", ["user_id"], :name => "index_groups_on_user_id"
+ create_table "hooks", :force => true do |t|
+ t.integer "user_id"
+ t.integer "repository_id"
+ t.string "url"
+ t.string "last_response"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "hooks", ["repository_id"], :name => "index_hooks_on_repository_id"
+
create_table "memberships", :force => true do |t|
t.integer "group_id"
t.integer "user_id"