]> git.openstreetmap.org Git - rails.git/commitdiff
Add a user index to diary comments
authorTom Hughes <tom@compton.nu>
Thu, 29 Apr 2010 23:21:57 +0000 (00:21 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 6 May 2010 16:18:34 +0000 (17:18 +0100)
db/migrate/050_add_user_index_to_diary_comments.rb [new file with mode: 0644]

diff --git a/db/migrate/050_add_user_index_to_diary_comments.rb b/db/migrate/050_add_user_index_to_diary_comments.rb
new file mode 100644 (file)
index 0000000..e1fe0de
--- /dev/null
@@ -0,0 +1,9 @@
+class AddUserIndexToDiaryComments < ActiveRecord::Migration
+  def self.up
+    add_index :diary_comments, [:user_id, :created_at], :name => "diary_comment_user_id_created_at_index"
+  end
+
+  def self.down
+    remove_index :diary_comments, :name => "diary_comment_user_id_created_at_index"
+  end
+end