Permalink
Browse files

adding indexes

  • Loading branch information...
1 parent 5b4c07e commit 24abb786675c9ba4ce650b2acdb1521256b90ec8 @tenderlove tenderlove committed Jan 6, 2011
Showing with 32 additions and 1 deletion.
  1. +19 −0 db/migrate/20110106191812_add_indexes.rb
  2. +13 −1 db/schema.rb
@@ -0,0 +1,19 @@
+class AddIndexes < ActiveRecord::Migration
+ def self.up
+ add_index 'names', 'account_id'
+ add_index 'sites', 'account_id'
+ add_index 'services', 'account_id'
+ add_index 'portraits', 'account_id'
+ add_index 'books', 'account_id'
+ add_index 'nicks', 'account_id'
+ end
+
+ def self.down
+ remove_index 'nicks', :column => 'account_id'
+ remove_index 'books', :column => 'account_id'
+ remove_index 'portraits', :column => 'account_id'
+ remove_index 'services', :column => 'account_id'
+ remove_index 'sites', :column => 'account_id'
+ remove_index 'names', :column => 'account_id'
+ end
+end
View
@@ -10,7 +10,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20110101002342) do
+ActiveRecord::Schema.define(:version => 20110106191812) do
create_table "accounts", :force => true do |t|
t.string "username"
@@ -25,27 +25,35 @@
t.datetime "updated_at"
end
+ add_index "books", ["account_id"], :name => "index_books_on_account_id"
+
create_table "names", :force => true do |t|
t.string "value"
t.integer "account_id"
t.datetime "created_at"
t.datetime "updated_at"
end
+ add_index "names", ["account_id"], :name => "index_names_on_account_id"
+
create_table "nicks", :force => true do |t|
t.string "value"
t.integer "account_id"
t.datetime "created_at"
t.datetime "updated_at"
end
+ add_index "nicks", ["account_id"], :name => "index_nicks_on_account_id"
+
create_table "portraits", :force => true do |t|
t.string "url"
t.integer "account_id"
t.datetime "created_at"
t.datetime "updated_at"
end
+ add_index "portraits", ["account_id"], :name => "index_portraits_on_account_id"
+
create_table "services", :force => true do |t|
t.string "name"
t.string "key"
@@ -54,6 +62,8 @@
t.datetime "updated_at"
end
+ add_index "services", ["account_id"], :name => "index_services_on_account_id"
+
create_table "sites", :force => true do |t|
t.string "title"
t.string "url"
@@ -64,4 +74,6 @@
t.datetime "updated_at"
end
+ add_index "sites", ["account_id"], :name => "index_sites_on_account_id"
+
end

0 comments on commit 24abb78

Please sign in to comment.