Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
remove duplicated indexes according to pghero (mastodon#13695)
Browse files Browse the repository at this point in the history
  • Loading branch information
lfuelling authored Jun 25, 2020
1 parent 0f8b8bf commit 62ef640
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
12 changes: 12 additions & 0 deletions db/migrate/20200510181721_remove_duplicated_indexes_pghero.rb
Original file line number Diff line number Diff line change
@@ -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

7 changes: 0 additions & 7 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
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

Expand All @@ -55,7 +54,6 @@
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|
Expand Down Expand Up @@ -85,7 +83,6 @@
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

Expand Down Expand Up @@ -207,7 +204,6 @@
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

Expand All @@ -219,7 +215,6 @@
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
Expand Down Expand Up @@ -264,7 +259,6 @@
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

Expand Down Expand Up @@ -475,7 +469,6 @@
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|
Expand Down

0 comments on commit 62ef640

Please sign in to comment.