From 07a54c473e09e85ab3dfa051a1b975f5a580459a Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Tue, 28 Dec 2021 14:56:23 +0100 Subject: [PATCH] Add `notifications` table indexes for `recipient_id` & `new` --- .../20211228135426_add_indexes_to_notifications.rb | 6 ++++++ db/schema.rb | 9 +++------ 2 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20211228135426_add_indexes_to_notifications.rb diff --git a/db/migrate/20211228135426_add_indexes_to_notifications.rb b/db/migrate/20211228135426_add_indexes_to_notifications.rb new file mode 100644 index 00000000..15288920 --- /dev/null +++ b/db/migrate/20211228135426_add_indexes_to_notifications.rb @@ -0,0 +1,6 @@ +class AddIndexesToNotifications < ActiveRecord::Migration[5.2] + def change + add_index :notifications, :recipient_id + add_index :notifications, :new + end +end diff --git a/db/schema.rb b/db/schema.rb index eb8141ef..017794d2 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: 2021_12_19_153054) do +ActiveRecord::Schema.define(version: 2021_12_28_135426) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -114,6 +114,8 @@ ActiveRecord::Schema.define(version: 2021_12_19_153054) do t.boolean "new" t.datetime "created_at" t.datetime "updated_at" + t.index ["new"], name: "index_notifications_on_new" + t.index ["recipient_id"], name: "index_notifications_on_recipient_id" end create_table "profiles", force: :cascade do |t| @@ -257,12 +259,7 @@ ActiveRecord::Schema.define(version: 2021_12_19_153054) do t.integer "asked_count", default: 0, null: false t.integer "answered_count", default: 0, null: false t.integer "commented_count", default: 0, null: false - t.string "display_name" t.integer "smiled_count", default: 0, null: false - t.string "motivation_header", default: "", null: false - t.string "website", default: "", null: false - t.string "location", default: "", null: false - t.text "bio", default: "", null: false t.string "profile_picture_file_name" t.boolean "profile_picture_processing" t.integer "profile_picture_x"