Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding indexes

  • Loading branch information...
commit 24abb786675c9ba4ce650b2acdb1521256b90ec8 1 parent 5b4c07e
@tenderlove authored
Showing with 32 additions and 1 deletion.
  1. +19 −0 db/migrate/20110106191812_add_indexes.rb
  2. +13 −1 db/schema.rb
View
19 db/migrate/20110106191812_add_indexes.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
14 db/schema.rb
@@ -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,6 +25,8 @@
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"
@@ -32,6 +34,8 @@
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"
@@ -39,6 +43,8 @@
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"
@@ -46,6 +52,8 @@
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
Please sign in to comment.
Something went wrong with that request. Please try again.