From 594960dc63f1e627efbdd24e1a3d3d6203655a68 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 13 May 2010 18:16:31 +0100 Subject: [PATCH 1/1] Add user_id + created_at index to changesets Browsing changesets for a user will be much faster if we can get the user's changesets in date order. --- .../20100513171259_add_user_date_index_to_changeset.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 db/migrate/20100513171259_add_user_date_index_to_changeset.rb diff --git a/db/migrate/20100513171259_add_user_date_index_to_changeset.rb b/db/migrate/20100513171259_add_user_date_index_to_changeset.rb new file mode 100644 index 000000000..22e1f08fb --- /dev/null +++ b/db/migrate/20100513171259_add_user_date_index_to_changeset.rb @@ -0,0 +1,9 @@ +class AddUserDateIndexToChangeset < ActiveRecord::Migration + def self.up + add_index :changesets, [:user_id, :created_at], :name => "changesets_user_id_created_at_idx" + end + + def self.down + remove_index :changesets, [:user_id, :created_at], :name => "changesets_user_id_created_at_idx" + end +end -- 2.39.5