about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2017-07-26 10:35:25 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-07-26 03:35:25 +0200
commit7bf0afb1dc5cb3d91f568f974b330cafa2922c2a (patch)
tree768f12eaf14528e788e6caf3a659072b02eea1b8 /db/migrate
parent2f8bfb3d387e1c187f90c9dbbaaa011447269213 (diff)
Add index favourites on account_id and id (#4360)
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb b/db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb
new file mode 100644
index 000000000..99903584c
--- /dev/null
+++ b/db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb
@@ -0,0 +1,6 @@
+class AddIndexFavouritesOnAccountIdAndId < ActiveRecord::Migration[5.1]
+  def change
+    # Used to query favourites of an account ordered by id.
+    add_index :favourites, [:account_id, :id]
+  end
+end