about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-08-22 20:56:32 +0200
committerThibaut Girka <thib@sitedethib.com>2018-08-22 20:56:32 +0200
commite70fc059a9511d43b42c2502514f6220b416cdd5 (patch)
treeabc0ea9862c55c2e114c855b20eb4a35f1141709 /db/migrate
parent628fca50e20bcf41f206877083fc5ee8789c1088 (diff)
parent56f882aed6fc81bbe4fb8821f11ba196795c99a8 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20180820232245_add_foreign_key_indices.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20180820232245_add_foreign_key_indices.rb b/db/migrate/20180820232245_add_foreign_key_indices.rb
new file mode 100644
index 000000000..e346c1f5b
--- /dev/null
+++ b/db/migrate/20180820232245_add_foreign_key_indices.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class AddForeignKeyIndices < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def change
+    add_index :follows, :target_account_id, algorithm: :concurrently
+    add_index :blocks, :target_account_id, algorithm: :concurrently
+    add_index :mutes, :target_account_id, algorithm: :concurrently
+    add_index :notifications, :from_account_id, algorithm: :concurrently
+    add_index :accounts, :moved_to_account_id, algorithm: :concurrently
+    add_index :statuses, :in_reply_to_account_id, algorithm: :concurrently
+    add_index :session_activations, :access_token_id, algorithm: :concurrently
+    add_index :oauth_access_grants, :resource_owner_id, algorithm: :concurrently
+  end
+end