From 8fde90c30c99629c17535d21577354eb4e4013f4 Mon Sep 17 00:00:00 2001
From: ArtOfCode- <hello@artofcode.co.uk>
Date: Wed, 1 Jul 2020 14:26:08 +0100
Subject: [PATCH] Index post score

---
 db/migrate/20200701132522_add_index_to_post_score.rb | 5 +++++
 db/schema.rb                                         | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 db/migrate/20200701132522_add_index_to_post_score.rb

diff --git a/db/migrate/20200701132522_add_index_to_post_score.rb b/db/migrate/20200701132522_add_index_to_post_score.rb
new file mode 100644
index 000000000..73cd3e598
--- /dev/null
+++ b/db/migrate/20200701132522_add_index_to_post_score.rb
@@ -0,0 +1,5 @@
+class AddIndexToPostScore < ActiveRecord::Migration[5.2]
+  def change
+    add_index :posts, :score
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 2235b7b0c..d00a71643 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: 2020_06_30_105117) do
+ActiveRecord::Schema.define(version: 2020_07_01_132522) do
 
   create_table "active_storage_attachments", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci", force: :cascade do |t|
     t.string "name", null: false
@@ -252,6 +252,7 @@ ActiveRecord::Schema.define(version: 2020_06_30_105117) do
     t.index ["license_id"], name: "index_posts_on_license_id"
     t.index ["parent_id"], name: "index_posts_on_parent_id"
     t.index ["post_type_id"], name: "index_posts_on_post_type_id"
+    t.index ["score"], name: "index_posts_on_score"
     t.index ["tags_cache"], name: "index_posts_on_tags_cache"
     t.index ["user_id"], name: "index_posts_on_user_id"
   end
-- 
GitLab