From b50c2d333db821c40aaad108de6aa2255ec7fa58 Mon Sep 17 00:00:00 2001 From: Anna Buianova Date: Tue, 30 Apr 2019 16:35:30 +0300 Subject: [PATCH] Add indexes to classified_listings (#2624) --- .../20190430123156_add_indexes_to_classified_listings.rb | 6 ++++++ db/schema.rb | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20190430123156_add_indexes_to_classified_listings.rb diff --git a/db/migrate/20190430123156_add_indexes_to_classified_listings.rb b/db/migrate/20190430123156_add_indexes_to_classified_listings.rb new file mode 100644 index 000000000..14aa76461 --- /dev/null +++ b/db/migrate/20190430123156_add_indexes_to_classified_listings.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 2f418a3e4..60cf90a2f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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|