Add: #641 preview_cardsmedia_attachmentsにインデックスを追加 (#674)

This commit is contained in:
KMY(雪あすか) 2024-03-27 08:42:08 +09:00 committed by GitHub
parent b3510acc32
commit a4523b833d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 1 deletions

View file

@ -0,0 +1,10 @@
# frozen_string_literal: true
class ImprovePreviewCardsVacuum < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def change
add_index :preview_cards, :id, name: 'index_preview_cards_vacuum', where: "image_file_name IS NOT NULL AND image_file_name <> ''", algorithm: :concurrently
add_index :media_attachments, :id, name: 'index_media_attachments_vacuum', where: "file_file_name IS NOT NULL AND remote_url <> ''", algorithm: :concurrently
end
end