Add the changeset id to the user index so the next/previous user links
authorTom Hughes <tom@compton.nu>
Thu, 14 Jan 2010 18:37:52 +0000 (18:37 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 14 Jan 2010 18:37:52 +0000 (18:37 +0000)
can be resolved quickly.

db/migrate/049_improve_changeset_user_index.rb [new file with mode: 0644]

diff --git a/db/migrate/049_improve_changeset_user_index.rb b/db/migrate/049_improve_changeset_user_index.rb
new file mode 100644 (file)
index 0000000..af5d1a2
--- /dev/null
@@ -0,0 +1,11 @@
+class ImproveChangesetUserIndex < ActiveRecord::Migration
+  def self.up
+    add_index :changesets, [:user_id, :id], :name => "changesets_user_id_id_idx"
+    remove_index :changesets, :name => "changesets_user_id_idx"
+  end
+
+  def self.down
+    add_index :changesets, [:user_id], :name => "changesets_user_id_idx"
+    remove_index :changesets, [:user_id, :id], :name => "changesets_user_id_id_idx"
+  end
+end