about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-08-30 05:04:20 +0200
committerGitHub <noreply@github.com>2017-08-30 05:04:20 +0200
commitfcca31350d05064a117c5f1c1b014875dc12afd3 (patch)
treece1e6873453c127d49b8e72bac86fa235a23cb36
parentee72a396417c9a2f9ec44732f58a8a4ab43d11b8 (diff)
Remove unneccesary indices (#4738)
We only look up status_pins by account_id, or account_id and status_id,
never by status_id
-rw-r--r--db/migrate/20170829215220_remove_status_pins_account_index.rb6
-rw-r--r--db/schema.rb4
2 files changed, 7 insertions, 3 deletions
diff --git a/db/migrate/20170829215220_remove_status_pins_account_index.rb b/db/migrate/20170829215220_remove_status_pins_account_index.rb
new file mode 100644
index 000000000..e0144242e
--- /dev/null
+++ b/db/migrate/20170829215220_remove_status_pins_account_index.rb
@@ -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
diff --git a/db/schema.rb b/db/schema.rb
index 7754894bc..5bef5948b 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -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|