Add indexes to classified_listings (#2624)

This commit is contained in:
Anna Buianova 2019-04-30 16:35:30 +03:00 committed by Ben Halpern
parent d2d405ad37
commit b50c2d333d
2 changed files with 9 additions and 3 deletions

View file

@ -0,0 +1,6 @@
class AddIndexesToClassifiedListings < ActiveRecord::Migration[5.2]
def change
add_index :classified_listings, :user_id
add_index :classified_listings, :organization_id
end
end

View file

@ -1,5 +1,3 @@
# frozen_string_literal: true
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
@ -12,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_04_25_210432) do
ActiveRecord::Schema.define(version: 2019_04_30_123156) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -246,6 +244,8 @@ ActiveRecord::Schema.define(version: 2019_04_25_210432) do
t.string "title"
t.datetime "updated_at", null: false
t.bigint "user_id"
t.index ["organization_id"], name: "index_classified_listings_on_organization_id"
t.index ["user_id"], name: "index_classified_listings_on_user_id"
end
create_table "collections", id: :serial, force: :cascade do |t|