FIX: add_directory_items_indexes causes migration to timeout on large databases, so create indexes concurrently
This commit is contained in:
parent
478418e780
commit
6d68aac6eb
|
@ -1,11 +1,13 @@
|
|||
class AddDirectoryItemsIndexes < ActiveRecord::Migration
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_index :directory_items, :likes_received
|
||||
add_index :directory_items, :likes_given
|
||||
add_index :directory_items, :topics_entered
|
||||
add_index :directory_items, :topic_count
|
||||
add_index :directory_items, :post_count
|
||||
add_index :directory_items, :posts_read
|
||||
add_index :directory_items, :days_visited
|
||||
add_index :directory_items, :likes_received, algorithm: :concurrently
|
||||
add_index :directory_items, :likes_given, algorithm: :concurrently
|
||||
add_index :directory_items, :topics_entered, algorithm: :concurrently
|
||||
add_index :directory_items, :topic_count, algorithm: :concurrently
|
||||
add_index :directory_items, :post_count, algorithm: :concurrently
|
||||
add_index :directory_items, :posts_read, algorithm: :concurrently
|
||||
add_index :directory_items, :days_visited, algorithm: :concurrently
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue