about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-08-21 20:11:34 +0200
committerGitHub <noreply@github.com>2018-08-21 20:11:34 +0200
commit025a06d3228fc518c91a98e617652655bb778e5f (patch)
tree433c2fe4213bc54890121eb362312fdc6dd067a9 /db/migrate
parent513cb20b750ea347863a9c4cc6b7f04558268bbe (diff)
Add missing indices for ON DELETE CASCADE constraints (#8332)
Fix #8327
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