about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorLerk <lukas@k40s.net>2020-06-25 12:15:34 +0200
committerGitHub <noreply@github.com>2020-06-25 12:15:34 +0200
commit62ef6406cd67170d3eb57d2a1d55fb074a9d603c (patch)
treeb6e9794659c837b284f5f03b24cb9c2eefeba45e /db
parent0f8b8bf126b5c7f9a7257dc0c693827db1d4f436 (diff)
remove duplicated indexes according to pghero (#13695)
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20200510181721_remove_duplicated_indexes_pghero.rb12
-rw-r--r--db/schema.rb7
2 files changed, 12 insertions, 7 deletions
diff --git a/db/migrate/20200510181721_remove_duplicated_indexes_pghero.rb b/db/migrate/20200510181721_remove_duplicated_indexes_pghero.rb
new file mode 100644
index 000000000..e2eaf46f1
--- /dev/null
+++ b/db/migrate/20200510181721_remove_duplicated_indexes_pghero.rb
@@ -0,0 +1,12 @@
+class RemoveDuplicatedIndexesPghero < ActiveRecord::Migration[5.2]
+  def change
+    remove_index :account_conversations, name: "index_account_conversations_on_account_id", column: :account_id
+    remove_index :account_identity_proofs, name: "index_account_identity_proofs_on_account_id", column: :account_id
+    remove_index :account_pins, name: "index_account_pins_on_account_id", column: :account_id
+    remove_index :announcement_mutes, name: "index_announcement_mutes_on_account_id", column: :account_id
+    remove_index :announcement_reactions, name: "index_announcement_reactions_on_account_id", column: :account_id
+    remove_index :bookmarks, name: "index_bookmarks_on_account_id", column: :account_id
+    remove_index :markers, name: "index_markers_on_user_id", column: :user_id
+  end
+end
+
diff --git a/db/schema.rb b/db/schema.rb
index acc4ffb1a..d603d98d7 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -33,7 +33,6 @@ ActiveRecord::Schema.define(version: 2020_06_20_164023) do
     t.integer "lock_version", default: 0, null: false
     t.boolean "unread", default: false, null: false
     t.index ["account_id", "conversation_id", "participant_account_ids"], name: "index_unique_conversations", unique: true
-    t.index ["account_id"], name: "index_account_conversations_on_account_id"
     t.index ["conversation_id"], name: "index_account_conversations_on_conversation_id"
   end
 
@@ -55,7 +54,6 @@ ActiveRecord::Schema.define(version: 2020_06_20_164023) do
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.index ["account_id", "provider", "provider_username"], name: "index_account_proofs_on_account_and_provider_and_username", unique: true
-    t.index ["account_id"], name: "index_account_identity_proofs_on_account_id"
   end
 
   create_table "account_migrations", force: :cascade do |t|
@@ -85,7 +83,6 @@ ActiveRecord::Schema.define(version: 2020_06_20_164023) do
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.index ["account_id", "target_account_id"], name: "index_account_pins_on_account_id_and_target_account_id", unique: true
-    t.index ["account_id"], name: "index_account_pins_on_account_id"
     t.index ["target_account_id"], name: "index_account_pins_on_target_account_id"
   end
 
@@ -207,7 +204,6 @@ ActiveRecord::Schema.define(version: 2020_06_20_164023) do
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.index ["account_id", "announcement_id"], name: "index_announcement_mutes_on_account_id_and_announcement_id", unique: true
-    t.index ["account_id"], name: "index_announcement_mutes_on_account_id"
     t.index ["announcement_id"], name: "index_announcement_mutes_on_announcement_id"
   end
 
@@ -219,7 +215,6 @@ ActiveRecord::Schema.define(version: 2020_06_20_164023) do
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.index ["account_id", "announcement_id", "name"], name: "index_announcement_reactions_on_account_id_and_announcement_id", unique: true
-    t.index ["account_id"], name: "index_announcement_reactions_on_account_id"
     t.index ["announcement_id"], name: "index_announcement_reactions_on_announcement_id"
     t.index ["custom_emoji_id"], name: "index_announcement_reactions_on_custom_emoji_id"
   end
@@ -264,7 +259,6 @@ ActiveRecord::Schema.define(version: 2020_06_20_164023) do
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.index ["account_id", "status_id"], name: "index_bookmarks_on_account_id_and_status_id", unique: true
-    t.index ["account_id"], name: "index_bookmarks_on_account_id"
     t.index ["status_id"], name: "index_bookmarks_on_status_id"
   end
 
@@ -475,7 +469,6 @@ ActiveRecord::Schema.define(version: 2020_06_20_164023) do
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
     t.index ["user_id", "timeline"], name: "index_markers_on_user_id_and_timeline", unique: true
-    t.index ["user_id"], name: "index_markers_on_user_id"
   end
 
   create_table "media_attachments", force: :cascade do |t|