Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
Qpixel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Answers
Qpixel
Commits
53bd3f4b
Commit
53bd3f4b
authored
Jul 1, 2020
by
ArtOfCode-
Browse files
Options
Downloads
Patches
Plain Diff
Index vote counts
parent
8fde90c3
Loading
Loading
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
db/migrate/20200701132654_add_indexes_to_vote_counts.rb
+6
-0
6 additions, 0 deletions
db/migrate/20200701132654_add_indexes_to_vote_counts.rb
db/schema.rb
+3
-1
3 additions, 1 deletion
db/schema.rb
with
9 additions
and
1 deletion
db/migrate/20200701132654_add_indexes_to_vote_counts.rb
0 → 100644
+
6
−
0
View file @
53bd3f4b
class
AddIndexesToVoteCounts
<
ActiveRecord
::
Migration
[
5.2
]
def
change
add_index
:posts
,
:upvote_count
add_index
:posts
,
:downvote_count
end
end
This diff is collapsed.
Click to expand it.
db/schema.rb
+
3
−
1
View file @
53bd3f4b
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
#
#
# It's strongly recommended that you check this file into your version control system.
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2020_07_01_132
522
)
do
ActiveRecord
::
Schema
.
define
(
version:
2020_07_01_132
654
)
do
create_table
"active_storage_attachments"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"
,
force: :cascade
do
|
t
|
create_table
"active_storage_attachments"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"
,
force: :cascade
do
|
t
|
t
.
string
"name"
,
null:
false
t
.
string
"name"
,
null:
false
...
@@ -246,6 +246,7 @@ ActiveRecord::Schema.define(version: 2020_07_01_132522) do
...
@@ -246,6 +246,7 @@ ActiveRecord::Schema.define(version: 2020_07_01_132522) do
t
.
index
[
"close_reason_id"
],
name:
"index_posts_on_close_reason_id"
t
.
index
[
"close_reason_id"
],
name:
"index_posts_on_close_reason_id"
t
.
index
[
"community_id"
],
name:
"index_posts_on_community_id"
t
.
index
[
"community_id"
],
name:
"index_posts_on_community_id"
t
.
index
[
"deleted"
],
name:
"index_posts_on_deleted"
t
.
index
[
"deleted"
],
name:
"index_posts_on_deleted"
t
.
index
[
"downvote_count"
],
name:
"index_posts_on_downvote_count"
t
.
index
[
"duplicate_post_id"
],
name:
"index_posts_on_duplicate_post_id"
t
.
index
[
"duplicate_post_id"
],
name:
"index_posts_on_duplicate_post_id"
t
.
index
[
"last_activity"
],
name:
"index_posts_on_last_activity"
t
.
index
[
"last_activity"
],
name:
"index_posts_on_last_activity"
t
.
index
[
"last_activity_by_id"
],
name:
"index_posts_on_last_activity_by_id"
t
.
index
[
"last_activity_by_id"
],
name:
"index_posts_on_last_activity_by_id"
...
@@ -254,6 +255,7 @@ ActiveRecord::Schema.define(version: 2020_07_01_132522) do
...
@@ -254,6 +255,7 @@ ActiveRecord::Schema.define(version: 2020_07_01_132522) do
t
.
index
[
"post_type_id"
],
name:
"index_posts_on_post_type_id"
t
.
index
[
"post_type_id"
],
name:
"index_posts_on_post_type_id"
t
.
index
[
"score"
],
name:
"index_posts_on_score"
t
.
index
[
"score"
],
name:
"index_posts_on_score"
t
.
index
[
"tags_cache"
],
name:
"index_posts_on_tags_cache"
t
.
index
[
"tags_cache"
],
name:
"index_posts_on_tags_cache"
t
.
index
[
"upvote_count"
],
name:
"index_posts_on_upvote_count"
t
.
index
[
"user_id"
],
name:
"index_posts_on_user_id"
t
.
index
[
"user_id"
],
name:
"index_posts_on_user_id"
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment