Skip to content

Commit

Permalink
Index UGC on held_reason
Browse files Browse the repository at this point in the history
  • Loading branch information
NuckChorris committed Nov 24, 2024
1 parent 278644f commit 5ef7e4c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions db/migrate/20241124071050_index_held_reasons.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class IndexHeldReasons < ActiveRecord::Migration[6.1]
disable_ddl_transaction!

def change
add_index :posts, :held_reason, algorithm: :concurrently
add_index :comments, :held_reason, algorithm: :concurrently
add_index :media_reactions, :held_reason, algorithm: :concurrently
end
end
3 changes: 3 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@
t.integer "held_reason"
t.index ["ao_id"], name: "index_comments_on_ao_id", unique: true
t.index ["deleted_at"], name: "index_comments_on_deleted_at"
t.index ["held_reason"], name: "index_comments_on_held_reason"
t.index ["parent_id"], name: "index_comments_on_parent_id"
t.index ["post_id"], name: "index_comments_on_post_id"
t.index ["user_id"], name: "index_comments_on_user_id"
Expand Down Expand Up @@ -1032,6 +1033,7 @@
t.index ["anime_id"], name: "index_media_reactions_on_anime_id"
t.index ["deleted_at"], name: "index_media_reactions_on_deleted_at"
t.index ["drama_id"], name: "index_media_reactions_on_drama_id"
t.index ["held_reason"], name: "index_media_reactions_on_held_reason"
t.index ["library_entry_id"], name: "index_media_reactions_on_library_entry_id"
t.index ["manga_id"], name: "index_media_reactions_on_manga_id"
t.index ["media_type", "media_id", "user_id"], name: "index_media_reactions_on_media_type_and_media_id_and_user_id", unique: true, where: "(deleted_at IS NULL)"
Expand Down Expand Up @@ -1244,6 +1246,7 @@
t.index ["ao_id"], name: "index_posts_on_ao_id", unique: true
t.index ["community_recommendation_id"], name: "index_posts_on_community_recommendation_id"
t.index ["deleted_at"], name: "index_posts_on_deleted_at"
t.index ["held_reason"], name: "index_posts_on_held_reason"
t.index ["locked_by_id"], name: "index_posts_on_locked_by_id"
t.index ["media_type", "media_id"], name: "posts_media_type_media_id_idx"
t.index ["target_group_id"], name: "posts_target_group_id_idx"
Expand Down

0 comments on commit 5ef7e4c

Please sign in to comment.