Add an index on message sender.
authorTom Hughes <tom@compton.nu>
Mon, 3 Aug 2009 23:04:41 +0000 (23:04 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 3 Aug 2009 23:04:41 +0000 (23:04 +0000)
db/migrate/038_add_message_sender_index.rb [new file with mode: 0644]

diff --git a/db/migrate/038_add_message_sender_index.rb b/db/migrate/038_add_message_sender_index.rb
new file mode 100644 (file)
index 0000000..2b9b134
--- /dev/null
@@ -0,0 +1,9 @@
+class AddMessageSenderIndex < ActiveRecord::Migration
+  def self.up
+    add_index :messages, [:from_user_id], :name=> "messages_from_user_id_idx"
+  end
+
+  def self.down
+    drop_index :messages, :name=> "messages_from_user_id_idx"
+  end
+end