summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorMrYummy <elemental428@gmail.com>2017-05-28 18:08:57 -0400
committerMrYummy <elemental428@gmail.com>2017-06-18 13:11:36 -0400
commit1316d7ca0335dd4ff5f8b4c7bb46e961b37503f0 (patch)
tree50259904cb3614f3161ef8a5c152017ef597a13d /db
parente7463524af03a62b8ba4adbdee29efe5f547c2d4 (diff)
Added Searching Features
* Added Thread Search Feature * Added User Search Feature * Re-organized searching, added @mention support to author search
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170522210610_add_search_indexes.rb8
-rw-r--r--db/schema.rb12
2 files changed, 17 insertions, 3 deletions
diff --git a/db/migrate/20170522210610_add_search_indexes.rb b/db/migrate/20170522210610_add_search_indexes.rb
new file mode 100644
index 0000000..2225d7b
--- /dev/null
+++ b/db/migrate/20170522210610_add_search_indexes.rb
@@ -0,0 +1,8 @@
+class AddSearchIndexes < ActiveRecord::Migration
+ def change
+ add_index :forumthreads, [:title, :content], type: :fulltext
+ add_index :forumthreads, :title, type: :fulltext
+ add_index :forumthreads, :content, type: :fulltext
+ add_index :threadreplies, :content, type: :fulltext
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 0a29b6b..aa35812 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20170515200733) do
+ActiveRecord::Schema.define(version: 20170522210610) do
create_table "blogposts", force: :cascade do |t|
t.string "title", limit: 191
@@ -65,6 +65,10 @@ ActiveRecord::Schema.define(version: 20170515200733) do
t.integer "label_id", limit: 4
end
+ add_index "forumthreads", ["content"], name: "index_forumthreads_on_content", type: :fulltext
+ add_index "forumthreads", ["title", "content"], name: "index_forumthreads_on_title_and_content", type: :fulltext
+ add_index "forumthreads", ["title"], name: "index_forumthreads_on_title", type: :fulltext
+
create_table "info", force: :cascade do |t|
t.string "title", limit: 191
t.text "content", limit: 65535
@@ -78,8 +82,8 @@ ActiveRecord::Schema.define(version: 20170515200733) do
end
create_table "register_tokens", force: :cascade do |t|
- t.string "uuid", limit: 191, null: false
- t.string "token", limit: 191, null: false
+ t.string "uuid", limit: 32, null: false
+ t.string "token", limit: 6, null: false
t.string "email", limit: 191, null: false
end
@@ -116,6 +120,8 @@ ActiveRecord::Schema.define(version: 20170515200733) do
t.datetime "updated_at"
end
+ add_index "threadreplies", ["content"], name: "index_threadreplies_on_content", type: :fulltext
+
create_table "users", force: :cascade do |t|
t.string "uuid", limit: 191, null: false
t.string "name", limit: 191, null: false