Skip to content

Commit

Permalink
Migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
brandon committed Jan 21, 2011
1 parent 8fbf80e commit 762ad31
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions db/migrate/20110121215527_adding_indexes.rb
@@ -0,0 +1,11 @@
class AddingIndexes < ActiveRecord::Migration
def self.up
add_index :users, :updated_at
add_index :friendships, :user_id
end

def self.down
remove_index :users, :updated_at
remove_index :friendships, :user_id
end
end
6 changes: 5 additions & 1 deletion db/schema.rb
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20110121211424) do
ActiveRecord::Schema.define(:version => 20110121215527) do

create_table "departments", :force => true do |t|
t.string "name"
Expand All @@ -26,6 +26,8 @@
t.datetime "updated_at"
end

add_index "friendships", ["user_id"], :name => "index_friendships_on_user_id"

create_table "slugs", :force => true do |t|
t.string "name"
t.integer "sluggable_id"
Expand Down Expand Up @@ -61,4 +63,6 @@
t.integer "department_id"
end

add_index "users", ["updated_at"], :name => "index_users_on_updated_at"

end

0 comments on commit 762ad31

Please sign in to comment.