Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding an index to speed up the website

  • Loading branch information...
commit 49d92fc1c82e8577512fe694c28c46ff4fbd1458 1 parent ce4980b
@suttree authored
View
9 db/migrate/20110627094041_index_on_articles_read_at.rb
@@ -0,0 +1,9 @@
+class IndexOnArticlesReadAt < ActiveRecord::Migration
+ def self.up
+ add_index :articles, :read_at
+ end
+
+ def self.down
+ remove_index :articles, :read_at
+ end
+end
View
4 db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20110111122744) do
+ActiveRecord::Schema.define(:version => 20110627094041) do
create_table "articles", :force => true do |t|
t.integer "user_id", :null => false
@@ -30,6 +30,8 @@
t.text "tweet_text"
end
+ add_index "articles", ["read_at"], :name => "index_articles_on_read_at"
+
create_table "email_addresses", :force => true do |t|
t.string "email"
t.integer "user_id"
Please sign in to comment.
Something went wrong with that request. Please try again.