fedibird-fe/db/migrate/20221230091953_add_personal_timeline_index.rb
2023-02-06 16:28:37 +09:00

11 lines
422 B
Ruby

class AddPersonalTimelineIndex < ActiveRecord::Migration[6.1]
disable_ddl_transaction!
def up
safety_assured { add_index :statuses, [:account_id, :id], where: 'visibility = 200 AND deleted_at IS NULL AND reblog_of_id IS NULL', order: { id: :desc }, algorithm: :concurrently, name: :index_statuses_personal_timeline }
end
def down
remove_index :statuses, name: :index_statuses_personal_timeline
end
end