1
0
mirror of https://github.com/whippyshou/mastodon synced 2024-11-24 15:16:26 +09:00

Remove unneccesary indices (#4738)

We only look up status_pins by account_id, or account_id and status_id,
never by status_id
This commit is contained in:
Eugen Rochko 2017-08-30 05:04:20 +02:00 committed by GitHub
parent ee72a39641
commit fcca31350d
2 changed files with 7 additions and 3 deletions

View File

@ -0,0 +1,6 @@
class RemoveStatusPinsAccountIndex < ActiveRecord::Migration[5.1]
def change
remove_index :status_pins, :account_id
remove_index :status_pins, :status_id
end
end

View File

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170824103029) do
ActiveRecord::Schema.define(version: 20170829215220) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -288,8 +288,6 @@ ActiveRecord::Schema.define(version: 20170824103029) do
t.datetime "created_at", default: -> { "now()" }, null: false
t.datetime "updated_at", default: -> { "now()" }, null: false
t.index ["account_id", "status_id"], name: "index_status_pins_on_account_id_and_status_id", unique: true
t.index ["account_id"], name: "index_status_pins_on_account_id"
t.index ["status_id"], name: "index_status_pins_on_status_id"
end
create_table "statuses", force: :cascade do |t|