--- /dev/null
+class AddIndexFavouritesOnAccountIdAndId < ActiveRecord::Migration[5.1]
+ def change
+ # Used to query favourites of an account ordered by id.
+ add_index :favourites, [:account_id, :id]
+ end
+end
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20170718211102) do
+ActiveRecord::Schema.define(version: 20170720000000) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
t.integer "status_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
+ t.index ["account_id", "id"], name: "index_favourites_on_account_id_and_id"
t.index ["account_id", "status_id"], name: "index_favourites_on_account_id_and_status_id", unique: true
t.index ["status_id"], name: "index_favourites_on_status_id"
end